Giter Club home page Giter Club logo

laser's People

Contributors

rkh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

laser's Issues

crash parser when defining method inside block

Reproductible with

$ cat c.rb 

class C

  send :each do
    def foo
    end 
  end

end
$ laser -d c.rb 
{:fix=>false, :display=>true, :"report-fixed"=>false, :"line-length"=>nil, :only=>nil, :stdin=>false, :"list-modules"=>false, :profile=>false, :debug=>true, :inline_comment_space=>2, :help=>false, :debug_given=>true}
/Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:182:in `build_formal_args': undefined method `is_block?' for nil:NilClass (NoMethodError)
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:904:in `block (3 levels) in walk_block_body'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:80:in `with_self'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:903:in `block (2 levels) in walk_block_body'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:276:in `with_current_basic_block'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:901:in `block in walk_block_body'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:803:in `with_jump_targets'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:900:in `walk_block_body'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:854:in `call_with_explicit_block'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:877:in `call_method_with_block'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:406:in `block in walk_node'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:284:in `with_current_node'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:291:in `walk_node'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:817:in `walk_body'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:1074:in `block in walk_body_with_rescue_target'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:803:in `with_jump_targets'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:1072:in `walk_body_with_rescue_target'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:1055:in `bodystmt_walk'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:294:in `block in walk_node'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:284:in `with_current_node'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:291:in `walk_node'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:1325:in `block (2 levels) in module_eval_instruct'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:80:in `with_self'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:1324:in `block in module_eval_instruct'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:59:in `with_scope'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:1323:in `module_eval_instruct'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:1251:in `class_instruct'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:297:in `block in walk_node'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:284:in `with_current_node'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:291:in `walk_node'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:822:in `block in walk_body'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:822:in `each'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:822:in `walk_body'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:437:in `block in walk_node'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:284:in `with_current_node'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:291:in `walk_node'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/cfg_builder.rb:28:in `build'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow.rb:22:in `perform_cfg_analysis'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:43:in `block in perform_load_time_analysis'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:38:in `each'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:38:in `perform_load_time_analysis'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:15:in `annotate_inputs'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/sexp_analysis.rb:10:in `analyze_inputs'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/sexp_analysis.rb:21:in `parse'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/sexp_analysis.rb:32:in `find_sexps'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/warnings/assignment_in_condition.rb:8:in `match?'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/warning.rb:93:in `generated_warnings'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/scanner.rb:166:in `block in scan_for_warnings'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/scanner.rb:166:in `map'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/scanner.rb:166:in `scan_for_warnings'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/scanner.rb:138:in `scan_for_file_warnings'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/scanner.rb:46:in `scan'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/runner.rb:161:in `block in collect_warnings'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/runner.rb:156:in `map'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/runner.rb:156:in `collect_warnings'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/runner.rb:18:in `run'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/bin/laser:7:in `<top (required)>'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/bin/laser:19:in `load'
    from /Users/riffraff/.rvm/gems/ruby-1.9.2-p180/bin/laser:19:in `<main>'

ruby: ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.4]
box: macbook pro osx snow leopard
laser: gem install laser --prerelease

This is basically the standard pattern to define a method on the association proxies in rails so it's a relatively useful feature to support, hope this helps to diagnose, and if needed I can do more tests and provide more details

Rails?

If I run this on, for instance, a model file in a Rails 3.0 project on 1.9.2 I get a stacktrace. Is this expected behavior?

"simulate_require" breaks when requiring standard libraries

laser is failing for me when my files require standard libraries, such as ostruct and pathname. It appears to assume that these libraries are part of my application. The error originates in Laser::Analysis::ControlFlow::Simulation#simulate_require:
`simulate_require': No such file: ostruct (LoadError)

Example:

$ rvm info

ruby-1.9.2-p290@dev:

  system:
    uname:       "Linux rsouza 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux"
    bash:        "/usr/local/bin/bash => GNU bash, version 4.2.8(1)-release (x86_64-pc-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.6.32 by Wayne E. Seguin ([email protected]) [https://rvm.beginrescueend.com/]"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.2p290"
    date:         "2011-07-09"
    platform:     "x86_64-linux"
    patchlevel:   "2011-07-09 revision 32553"
    full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]"

  homes:
    gem:          "/local/rvm/gems/ruby-1.9.2-p290@dev"
    ruby:         "/local/rvm/rubies/ruby-1.9.2-p290"

  binaries:
    ruby:         "/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby"
    irb:          "/local/rvm/rubies/ruby-1.9.2-p290/bin/irb"
    gem:          "/local/rvm/rubies/ruby-1.9.2-p290/bin/gem"
    rake:         "/local/rvm/gems/ruby-1.9.2-p290@dev/bin/rake"

  environment:
    PATH:         "/local/rvm/gems/ruby-1.9.2-p290@dev/bin:/local/rvm/gems/ruby-1.9.2-p290@global/bin:/local/rvm/rubies/ruby-1.9.2-p290/bin:/local/rvm/bin:/home/rsouza/bin:/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    GEM_HOME:     "/local/rvm/gems/ruby-1.9.2-p290@dev"
    GEM_PATH:     "/local/rvm/gems/ruby-1.9.2-p290@dev:/local/rvm/gems/ruby-1.9.2-p290@global"
    MY_RUBY_HOME: "/local/rvm/rubies/ruby-1.9.2-p290"
    IRBRC:        "/local/rvm/rubies/ruby-1.9.2-p290/.irbrc"
    RUBYOPT:      ""
    gemset:       "dev"


$ gem list laser

*** LOCAL GEMS ***

laser (0.7.0.pre1)


$ cat configuration.rb 
require 'ostruct'

class Configuration < OpenStruct
end


$ laser configuration.rb 
/local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/control_flow/simulation.rb:364:in `simulate_require': No such file: ostruct (LoadError)
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/control_flow/simulation.rb:279:in `simulate_special_method'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/control_flow/simulation.rb:229:in `simulate_call_dispatch'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/control_flow/simulation.rb:199:in `simulate_call'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/control_flow/simulation.rb:190:in `simulate_call_instruction'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/control_flow/simulation.rb:160:in `simulate_instruction'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/control_flow/simulation.rb:112:in `simulate_exit_instruction'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/control_flow/simulation.rb:96:in `simulate_block'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/control_flow/simulation.rb:41:in `block in simulate'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/control_flow/simulation.rb:39:in `loop'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/control_flow/simulation.rb:39:in `simulate'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/control_flow/control_flow_graph.rb:222:in `analyze'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/control_flow.rb:23:in `perform_cfg_analysis'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/annotations.rb:43:in `block in perform_load_time_analysis'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/annotations.rb:38:in `each'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/annotations.rb:38:in `perform_load_time_analysis'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/annotations.rb:15:in `annotate_inputs'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/sexp_analysis.rb:10:in `analyze_inputs'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/sexp_analysis.rb:21:in `parse'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/analysis/sexp_analysis.rb:32:in `find_sexps'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/warnings/useless_double_quotes.rb:16:in `match?'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/warning.rb:91:in `generated_warnings'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/scanner.rb:166:in `block in scan_for_warnings'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/scanner.rb:166:in `map'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/scanner.rb:166:in `scan_for_warnings'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/scanner.rb:138:in `scan_for_file_warnings'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/scanner.rb:46:in `scan'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/runner.rb:161:in `block in collect_warnings'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/runner.rb:156:in `map'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/runner.rb:156:in `collect_warnings'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/lib/laser/runner.rb:18:in `run'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/gems/laser-0.7.0.pre1/bin/laser:7:in `<top (required)>'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/bin/laser:19:in `load'
    from /local/rvm/gems/ruby-1.9.2-p290@dev/bin/laser:19:in `<main>'

cannot load such file -- treetop (LoadError)

I'm running MRI 1.9.3. I ran $ gem install laser -v 0.7.0.pre1 --pre then $ laser --help and get:

/Users/Steveloveless/.rvm/gems/ruby-1.9.3-p0/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `require': cannot load such file -- treetop (LoadError)
from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p0/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `<top (required)>'
from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p0/gems/laser-0.7.0.pre1/bin/laser:6:in `require'
from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p0/gems/laser-0.7.0.pre1/bin/laser:6:in `<top (required)>'
from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p0/bin/laser:19:in `load'
from /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p0/bin/laser:19:in `<main>'

I then $ gem install treetop, then $ laser and still get the same LoadError.

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.10
  - RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [x86_64-darwin11.2.0]
  - INSTALLATION DIRECTORY: /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p0
  - RUBY EXECUTABLE: /Users/Steveloveless/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p0/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-11
  - GEM PATHS:
     - /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p0
     - /Users/Steveloveless/.rvm/gems/ruby-1.9.3-p0@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => true
     - :bulk_threshold => 1000
     - :sources => ["http://rubygems.org/"]
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - http://rubygems.org/

Doesn't compile on cygwin / windows

If I try to install this gem on cygwin / windows, I get a compile error (see below).
All other gems install fine on my machine.

$ gem install laser --prerelease
ERROR:  Error installing laser:
        ERROR: Failed to build gem native extension.

        C:/Ruby193/bin/ruby.exe extconf.rb
checking for main() in -lstdc++... yes
creating Makefile

make
generating BasicBlock-i386-mingw32.def
compiling BasicBlock.cpp
cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from BasicBlock.cpp:1:0:
BasicBlock.h: In constructor 'Laser::BasicBlock::BasicBlock()':
BasicBlock.h:26:100: warning: converting to non-pointer type 'VALUE' from NULL
BasicBlock.h:26:100: warning: converting to non-pointer type 'VALUE' from NULL
linking shared-object laser/BasicBlock.so
c:/rubydevkit/mingw/bin/../lib/gcc/mingw32/4.5.2\libstdc++.a(stdexcept.o):stdexcept.cc:(.text+0x0): multiple definition of `std::logic_error::what() const'
c:/rubydevkit/mingw/bin/../lib/gcc/mingw32/4.5.2/libstdc++.dll.a(d000700.o):(.text+0x0): first defined here
c:/rubydevkit/mingw/bin/../lib/gcc/mingw32/4.5.2\libstdc++.a(stdexcept.o):stdexcept.cc:(.text+0xb0): multiple definition of `std::logic_error::~logic_error()'
c:/rubydevkit/mingw/bin/../lib/gcc/mingw32/4.5.2/libstdc++.dll.a(d001554.o):(.text+0x0): first defined here
c:/rubydevkit/mingw/bin/../lib/gcc/mingw32/4.5.2\libstdc++.a(stdexcept.o):stdexcept.cc:(.text+0x148): multiple definition of `std::logic_error::logic_error(std::string const&)'
c:/rubydevkit/mingw/bin/../lib/gcc/mingw32/4.5.2/libstdc++.dll.a(d001551.o):(.text+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [BasicBlock.so] Error 1


Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/ext/laser/gem_make.out
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...

"rake build" gives Syck error

Maybe just me?

$ rvm info

ruby-1.9.2-p290@laser:

  system:
    uname:       "Darwin tom-mac-2.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64"
    bash:        "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
    zsh:         "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"

  rvm:
    version:      "rvm 1.7.2 by Wayne E. Seguin ([email protected]) [https://rvm.beginrescueend.com/]"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.2p290"
    date:         "2011-07-09"
    platform:     "x86_64-darwin10.8.0"
    patchlevel:   "2011-07-09 revision 32553"
    full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]"

  homes:
    gem:          "/Users/tom/.rvm/gems/ruby-1.9.2-p290@laser"
    ruby:         "/Users/tom/.rvm/rubies/ruby-1.9.2-p290"

  binaries:
    ruby:         "/Users/tom/.rvm/rubies/ruby-1.9.2-p290/bin/ruby"
    irb:          "/Users/tom/.rvm/rubies/ruby-1.9.2-p290/bin/irb"
    gem:          "/Users/tom/.rvm/rubies/ruby-1.9.2-p290/bin/gem"
    rake:         "/Users/tom/.rvm/gems/ruby-1.9.2-p290@laser/bin/rake"

  environment:
    PATH:         "/Users/tom/.rvm/gems/ruby-1.9.2-p290@laser/bin:/Users/tom/.rvm/gems/ruby-1.9.2-p290@global/bin:/Users/tom/.rvm/rubies/ruby-1.9.2-p290/bin:/Users/tom/.rvm/bin:/usr/local/mysql51/bin/:/usr/local/maven/bin/:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0//Home/bin/:/Users/tom/bin:/usr/local/apache2/bin/:/usr/local/sphinx/bin/:/usr/local/pgsql/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/jmeter/bin/:/Users/tom/ec2-tools/bin/:/usr/local/fop/:/usr/local/ant/bin/:/usr/local/javacc/bin/:/usr/local/jruby/bin/:/Users/tom/src/android-sdk-mac_86/tools/:/Users/tom/src/flex-4.1/bin:/Applications/GitX.app/Contents/Resources/"
    GEM_HOME:     "/Users/tom/.rvm/gems/ruby-1.9.2-p290@laser"
    GEM_PATH:     "/Users/tom/.rvm/gems/ruby-1.9.2-p290@laser:/Users/tom/.rvm/gems/ruby-1.9.2-p290@global"
    MY_RUBY_HOME: "/Users/tom/.rvm/rubies/ruby-1.9.2-p290"
    IRBRC:        "/Users/tom/.rvm/rubies/ruby-1.9.2-p290/.irbrc"
    RUBYOPT:      ""
    gemset:       "laser"

$ rake build --trace
** Invoke build (first_time)
** Execute build
rake aborted!
undefined method `write' for #<Syck::Emitter:0x00000102313a00>
/Users/tom/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `end_document'
/Users/tom/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `visit_Psych_Nodes_Document'
/Users/tom/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/visitors/visitor.rb:10:in `accept'

Include option doesn't work

How is include supposed to work?

$ laser -Ilib lib/barcode_list.rb 
Error: option '-l' needs a parameter.
Try --help for help.
$ laser --includelib lib/barcode_list.rb 
Error: unknown argument '--includelib'.
Try --help for help.
$ laser --include=lib lib/barcode_list.rb 
/Users/agrimm/.rvm/gems/ruby-head/gems/laser-0.7.0.pre2/lib/laser/runner.rb:58:in `handle_global_options': undefined method `reverse' for true:TrueClass (NoMethodError)
    from /Users/agrimm/.rvm/gems/ruby-head/gems/laser-0.7.0.pre2/lib/laser/runner.rb:26:in `block in collect_options_and_arguments'
    from /Users/agrimm/.rvm/gems/ruby-head/gems/laser-0.7.0.pre2/lib/laser/runner.rb:147:in `swizzling_argv'
    from /Users/agrimm/.rvm/gems/ruby-head/gems/laser-0.7.0.pre2/lib/laser/runner.rb:24:in `collect_options_and_arguments'
    from /Users/agrimm/.rvm/gems/ruby-head/gems/laser-0.7.0.pre2/lib/laser/runner.rb:12:in `run'
    from /Users/agrimm/.rvm/gems/ruby-head/gems/laser-0.7.0.pre2/bin/laser:7:in `<top (required)>'
    from /Users/agrimm/.rvm/gems/ruby-head/bin/laser:19:in `load'
    from /Users/agrimm/.rvm/gems/ruby-head/bin/laser:19:in `<main>'
$ laser --include lib lib/barcode_list.rb 
/Users/agrimm/.rvm/gems/ruby-head/gems/laser-0.7.0.pre2/lib/laser/runner.rb:58:in `handle_global_options': undefined method `reverse' for true:TrueClass (NoMethodError)
    from /Users/agrimm/.rvm/gems/ruby-head/gems/laser-0.7.0.pre2/lib/laser/runner.rb:26:in `block in collect_options_and_arguments'
    from /Users/agrimm/.rvm/gems/ruby-head/gems/laser-0.7.0.pre2/lib/laser/runner.rb:147:in `swizzling_argv'
    from /Users/agrimm/.rvm/gems/ruby-head/gems/laser-0.7.0.pre2/lib/laser/runner.rb:24:in `collect_options_and_arguments'
    from /Users/agrimm/.rvm/gems/ruby-head/gems/laser-0.7.0.pre2/lib/laser/runner.rb:12:in `run'
    from /Users/agrimm/.rvm/gems/ruby-head/gems/laser-0.7.0.pre2/bin/laser:7:in `<top (required)>'
    from /Users/agrimm/.rvm/gems/ruby-head/bin/laser:19:in `load'
    from /Users/agrimm/.rvm/gems/ruby-head/bin/laser:19:in `<main>'

Security coverage

Hi,
I was looking for any Ruby static analysis tools that focussed on security. Laser came up as a static analysis tool, but it's not clear how much the tool focusses on security-testing. What's there level of security-scanning that it does?
Thanks,
Andrew

Simulate_require fails to require if extension is given

Using the test case:

a.rb:

class A
end 

b.rb:

require './a.rb'
class B
end

Then running:
laser b.rb

I get the following stack trace:
/usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/simulation.rb:369:in simulate_require': No such file: ./a.rb (LoadError)
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/simulation.rb:284:in simulate_special_method' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/simulation.rb:234:in simulate_call_dispatch'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/simulation.rb:199:in simulate_call' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/simulation.rb:190:in simulate_call_instruction'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/simulation.rb:160:in simulate_instruction' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/simulation.rb:112:in simulate_exit_instruction'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/simulation.rb:96:in simulate_block' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/simulation.rb:41:in block in simulate'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/simulation.rb:39:in loop' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/simulation.rb:39:in simulate'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/control_flow_graph.rb:222:in analyze' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow.rb:23:in perform_cfg_analysis'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:43:in block in perform_load_time_analysis' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:38:in each'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:38:in perform_load_time_analysis' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:15:in annotate_inputs'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/sexp_analysis.rb:10:in analyze_inputs' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/sexp_analysis.rb:21:in parse'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/analysis/sexp_analysis.rb:32:in find_sexps' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/warnings/rescue_exception.rb:11:in match?'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/warning.rb:93:in generated_warnings' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/scanner.rb:166:in block in scan_for_warnings'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/scanner.rb:166:in map' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/scanner.rb:166:in scan_for_warnings'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/scanner.rb:138:in scan_for_file_warnings' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/scanner.rb:46:in scan'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/runner.rb:161:in block in collect_warnings' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/runner.rb:156:in map'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/runner.rb:156:in collect_warnings' from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/lib/laser/runner.rb:18:in run'
from /usr/lib/ruby/gems/1.9.1/gems/laser-0.7.0.pre2/bin/laser:7:in <top (required)>' from /usr/bin/laser:19:in load'
from /usr/bin/laser:19:in <main>'

Whereas if I remove the ".rb" from the require line this works. I've tracked the problem down to /lib/laser/analysis/control_flow/simulation.rb:357 where you assume the trailing ".rb" is never present.

loading issues

~/Workspace/sinatra-contrib (git: master) ❷ gem install laser --prerelease
Fetching: ripper-plus-1.3.0.gem (100%)
Fetching: axiom_of_choice-1.0.0.gem (100%)
Fetching: stream-0.5.gem (100%)
Fetching: object_regex-1.0.1.gem (100%)
Fetching: trollop-1.16.2.gem (100%)
Fetching: laser-0.7.0.pre1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ripper-plus-1.3.0
Successfully installed axiom_of_choice-1.0.0
Successfully installed stream-0.5
Successfully installed object_regex-1.0.1
Successfully installed trollop-1.16.2
Successfully installed laser-0.7.0.pre1
6 gems installed
~/Workspace/sinatra-contrib (git: master) ❷ laser --help
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `require': no such file to load -- treetop (LoadError)
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `<top (required)>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/bin/laser:6:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/bin/laser:6:in `<top (required)>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/bin/laser:19:in `load'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/bin/laser:19:in `<main>'
~/Workspace/sinatra-contrib (git: master) ❷ gem install treetop
Fetching: treetop-1.4.10.gem (100%)
Successfully installed treetop-1.4.10
1 gem installed
~/Workspace/sinatra-contrib (git: master) ❷ laser --help
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `require': no such file to load -- treetop (LoadError)
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `<top (required)>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/bin/laser:6:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/bin/laser:6:in `<top (required)>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/bin/laser:19:in `load'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/bin/laser:19:in `<main>'
~/Workspace/sinatra-contrib (git: master) ❷ gem which treetop
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/treetop-1.4.10/lib/treetop
~/Workspace/sinatra-contrib (git: master) ❷ irb
reruby-1.9.2-p290 :001 > require 'treetop'
 => true 
ruby-1.9.2-p290 :002 > ^D
~/Workspace/sinatra-contrib (git: master) ❷ ruby -r treetop -S laser --help
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `require': no such file to load -- treetop (LoadError)
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `<top (required)>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/bin/laser:6:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/bin/laser:6:in `<top (required)>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/bin/laser:19:in `load'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/bin/laser:19:in `<main>'
~/Workspace/sinatra-contrib (git: master) ❷ irb
reruby-1.9.2-p290 :001 > require 'treetop'
 => true 
ruby-1.9.2-p290 :002 > require 'laser'
NameError: uninitialized constant Rake::DSL
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser/rake/task.rb:5:in `<class:LaserTask>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser/rake/task.rb:4:in `<module:Rake>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser/rake/task.rb:3:in `<module:Laser>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser/rake/task.rb:2:in `<top (required)>'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:91:in `<top (required)>'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
    from (irb):2
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
ruby-1.9.2-p290 :004 > require 'laser'
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:2: warning: already initialized constant VERSION
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:3: warning: already initialized constant TESTS_ACTIVATED
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:4: warning: already initialized constant ROOT
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:5: warning: already initialized constant SETTINGS
Warning: creating new instance of Class Object
Warning: creating new instance of Class Class
Warning: creating new instance of Class Module
Warning: creating new instance of Class BasicObject
Laser::Analysis::Bootstrap::BootstrappingError: Bootstrapping failed: GlobalScope has already been initialized
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser/analysis/bootstrap/bootstrap.rb:39:in `bootstrap'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:80:in `<top (required)>'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
    from (irb):4
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
ruby-1.9.2-p290 :005 > ^D

Getting stacktrace for anything I do

Hi, I'm on Mac OSX Lion, using Ruby 1.9.2 (tried on p180 and p290)

When I try to do anything (ie laser -h) I wind up with a stack trace.

I want to recommend it to someone on the ML who is wanting static arity analysis in their tests, but I'm not comfortable recommending it if breaks for me.

Here is an example:

$ laser -h
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations/comment_attachment_annotation.rb:40: [BUG] Bus Error
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin11.0.0]

-- control frame ----------
c:0028 p:---- s:0095 b:0095 l:000640 d:000640 CFUNC  :next
c:0027 p:0020 s:0092 b:0092 l:000091 d:000091 METHOD /Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations/comment_attachment_annotatio
c:0026 p:0020 s:0087 b:0087 l:000077 d:000086 BLOCK  /Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations/comment_attachment_annotatio
c:0025 p:---- s:0083 b:0083 l:000082 d:000082 FINISH
c:0024 p:---- s:0081 b:0081 l:000080 d:000080 CFUNC  :each
c:0023 p:0037 s:0078 b:0078 l:000077 d:000077 METHOD /Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations/comment_attachment_annotatio
c:0022 p:0122 s:0071 b:0071 l:000051 d:000070 BLOCK  /Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:29
c:0021 p:---- s:0065 b:0065 l:000064 d:000064 FINISH
c:0020 p:---- s:0063 b:0063 l:000062 d:000062 CFUNC  :each
c:0019 p:0011 s:0060 b:0060 l:000051 d:000059 BLOCK  /Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:23
c:0018 p:---- s:0057 b:0057 l:000056 d:000056 FINISH
c:0017 p:---- s:0055 b:0055 l:000054 d:000054 CFUNC  :each
c:0016 p:0017 s:0052 b:0052 l:000051 d:000051 METHOD /Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:22
c:0015 p:0028 s:0048 b:0048 l:000047 d:000047 METHOD /Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:14
c:0014 p:0026 s:0043 b:0043 l:000032 d:000042 BLOCK  /Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/bootstrap/bootstrap.rb:255
c:0013 p:---- s:0038 b:0038 l:000037 d:000037 FINISH
c:0012 p:---- s:0036 b:0036 l:000035 d:000035 CFUNC  :tap
c:0011 p:0038 s:0033 b:0033 l:000032 d:000032 METHOD /Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/bootstrap/bootstrap.rb:250
c:0010 p:0873 s:0030 b:0030 l:000029 d:000029 TOP    /Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser.rb:99
c:0009 p:---- s:0028 b:0028 l:000027 d:000027 FINISH
c:0008 p:---- s:0026 b:0026 l:000025 d:000025 CFUNC  :require
c:0007 p:0053 s:0022 b:0022 l:000021 d:000021 METHOD /Users/joshuajcheek/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36
c:0006 p:0054 s:0015 b:0015 l:000014 d:000014 TOP    /Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/bin/laser:6
c:0005 p:---- s:0013 b:0013 l:000012 d:000012 FINISH
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC  :load
c:0003 p:0127 s:0007 b:0007 l:0025d8 d:000440 EVAL   /Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/bin/laser:19
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0025d8 d:0025d8 TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/bin/laser:19:in `<main>'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/bin/laser:19:in `load'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/bin/laser:6:in `<top (required)>'
/Users/joshuajcheek/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/joshuajcheek/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser.rb:99:in `<top (required)>'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/bootstrap/bootstrap.rb:250:in `load_standard_library'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/bootstrap/bootstrap.rb:250:in `tap'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/bootstrap/bootstrap.rb:255:in `block in load_standard_library'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:14:in `annotate_inputs'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:22:in `apply_inherited_attributes'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:22:in `each'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:23:in `block in apply_inherited_attributes'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:23:in `each'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations.rb:29:in `block (2 levels) in apply_inherited_attributes'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations/comment_attachment_annotation.rb:21:in `annotate_with_text'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations/comment_attachment_annotation.rb:21:in `each'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations/comment_attachment_annotation.rb:23:in `block in annotate_with_text'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations/comment_attachment_annotation.rb:40:in `dfs_for_useful_node'
/Users/joshuajcheek/.rvm/gems/ruby-1.9.2-p180/gems/laser-0.7.0.pre2/lib/laser/analysis/annotations/comment_attachment_annotation.rb:40:in `next'

-- C level backtrace information -------------------------------------------
0   libruby.1.9.1.dylib                 0x000000010f82762e rb_vm_bugreport + 110
1   libruby.1.9.1.dylib                 0x000000010f71b493 report_bug + 259
2   libruby.1.9.1.dylib                 0x000000010f71b601 rb_bug + 161
3   libruby.1.9.1.dylib                 0x000000010f7be0a2 sigbus + 18
4   libsystem_c.dylib                   0x00007fff8e81dcfa _sigtramp + 26
5   ???                                 0x0000000000000004 0x0 + 4

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort trap: 6

laser requires laser

Recursive dependency.

C:\Documents and Settings\a.grimm\Desktop\code\sandbox\laser>gem install pkg\laser-0.5.2.gem
Fetching: polyglot-0.3.1.gem (100%)
Fetching: treetop-1.4.9.gem (100%)
Fetching: ripper-plus-1.3.0.gem (100%)
Fetching: axiom_of_choice-1.0.0.gem (100%)
Fetching: stream-0.5.gem (100%)
Fetching: object_regex-1.0.1.gem (100%)
Fetching: trollop-1.16.2.gem (100%)
ERROR:  Error installing pkg\laser-0.5.2.gem:
        laser requires laser (>= 0)

Trying again:

C:\Documents and Settings\a.grimm\Desktop\code\sandbox\laser>gem install pkg\laser-0.5.2.gem
ERROR:  Error installing pkg\laser-0.5.2.gem:
        laser requires laser (>= 0)

Trying all the switches I could find - I don't think it helps:

C:\Documents and Settings\a.grimm\Desktop\code\sandbox\laser>gem install --verbose pkg\laser-0.5.2.gem
GET http://rubygems.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
304 Not Modified
GET http://rubygems.org/specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/specs.4.8.gz
304 Not Modified
Installing gem laser-0.5.2
Using local gem C:/Ruby19/lib/ruby/gems/1.9.1/cache/laser-0.5.2.gem
ERROR:  Error installing pkg\laser-0.5.2.gem:
        laser requires laser (>= 0)

C:\Documents and Settings\a.grimm\Desktop\code\sandbox\laser>gem install --backtrace pkg\laser-0.5.2.gem
ERROR:  Error installing pkg\laser-0.5.2.gem:
        laser requires laser (>= 0)

C:\Documents and Settings\a.grimm\Desktop\code\sandbox\laser>gem install --debug pkg\laser-0.5.2.gem
Exception `NameError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:163 - uninitialized constant Gem::Commands::InstallCommand
Exception `LoadError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36 - no such file to load -- psych
Exception `LoadError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60 - no such file to load -- psych
Exception `NoMethodError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_input.rb:53 - undefined method `readpartial' for #<Gem::Package::TarReader::Entry:0x1a95360>
Exception `NoMethodError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:449 - undefined method `readpartial' for #<Gem::Package::TarReader::Entry:0x1a95360>
Exception `IOError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/format.rb:45 - closed stream
Exception `Gem::LoadError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems.rb:926 - Could not find RubyGem sources (> 0.0.1)

Exception `NoMethodError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_input.rb:53 - undefined method `readpartial' for #<Gem::Package::TarReader::Entry:0x2bedb00>
Exception `NoMethodError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:449 - undefined method `readpartial' for #<Gem::Package::TarReader::Entry:0x2bedb00>
Exception `IOError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/format.rb:45 - closed stream
Exception `Errno::EEXIST' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:243 - File exists - C:/Ruby19/lib/ruby/gems/1.9.1
Exception `Gem::InstallError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:208 - laser requires laser (>= 0)
ERROR:  Error installing pkg\laser-0.5.2.gem:
        laser requires laser (>= 0)

Compilation error on Windows

Running the following command on Windows with RubyInstaller installed Ruby

gem install --verbose --force pkg\laser-0.5.2.gem

gave me

Building native extensions.  This could take a while...
ERROR:  Error installing pkg\laser-0.5.2.gem:
        ERROR: Failed to build gem native extension.

        C:/Ruby19/bin/ruby.exe extconf.rb
checking for main() in -lstdc++... yes
creating Makefile

make
g++ -I. -IC:/Ruby19/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby19/include/ruby-1.9.1/ruby/backward -I/C/Ruby19/include/ruby-1.9.1 -I.   -O2 -g -Wall -Wno-parentheses     -o BasicBlock.o -c BasicBlock.cp
p
In file included from BasicBlock.cpp:1:0:
BasicBlock.h: In constructor 'Laser::BasicBlock::BasicBlock()':
BasicBlock.h:26:100: warning: converting to non-pointer type 'VALUE' from NULL
BasicBlock.h:26:100: warning: converting to non-pointer type 'VALUE' from NULL
g++ -shared -s -o BasicBlock.so BasicBlock.o -L. -LC:/Ruby19/lib -L.  -Wl,--enable-auto-image-base,--enable-auto-import   -lmsvcrt-ruby191 -lstdc++  -lshell32 -lws2_32
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1\libstdc++.a(stdexcept.o):stdexcept.cc:(.text+0x0): multiple definition of `std::logic_error::what() const'
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/libstdc++.dll.a(d000700.o):(.text+0x0): first defined here
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1\libstdc++.a(stdexcept.o):stdexcept.cc:(.text+0xb0): multiple definition of `std::logic_error::~logic_error()'
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/libstdc++.dll.a(d001554.o):(.text+0x0): first defined here
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1\libstdc++.a(stdexcept.o):stdexcept.cc:(.text+0x148): multiple definition of `std::logic_error::logic_error(std::string const&)'
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/libstdc++.dll.a(d001551.o):(.text+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [BasicBlock.so] Error 1


Gem files will remain installed in C:/Ruby19/lib/ruby/gems/1.9.1/gems/laser-0.5.2 for inspection.
Results logged to C:/Ruby19/lib/ruby/gems/1.9.1/gems/laser-0.5.2/ext/laser/gem_make.out

Let me know if you need more details.

Ripper problems on 1.8

Laser 0.7.0.pre2 has problems with regards to Ripper on Ruby 1.8.

With a fresh install:

agrimm@proline:$ ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
agrimm@proline:
$ ruby -S laser --version
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require': no such file to load -- ripper (LoadError) from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:inrequire'
from /var/lib/gems/1.8/gems/laser-0.7.0.pre2/bin/../lib/laser.rb:25
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:inrequire'
from /var/lib/gems/1.8/gems/laser-0.7.0.pre2/bin/laser:6
from /usr/local/bin/laser:19:in `load'
from /usr/local/bin/laser:19

Then once ripper is installed:

agrimm@proline:~$ ruby -S laser --version
/var/lib/gems/1.8/gems/ripper-plus-1.3.0/lib/ripper-plus.rb:2: ripper-plus requires Ruby 1.9+ (RuntimeError)
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:inpolyglot_original_require'
from /var/lib/gems/1.8/gems/polyglot-0.3.3/lib/polyglot.rb:63:in require' from /var/lib/gems/1.8/gems/laser-0.7.0.pre2/bin/../lib/laser.rb:27 from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:ingem_original_require'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in require' from /var/lib/gems/1.8/gems/laser-0.7.0.pre2/bin/laser:6 from /usr/local/bin/laser:19:inload'
from /usr/local/bin/laser:19

Don't know if this is the case on trunk.

Comparable#== will no more rescue exceptions of #<=> in the next release (after 2.2.2).

laser --help gives the following error when using Ruby 2.2.2. It gives it 3,820 times.

/usr/local/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/static_single_assignment.rb:174: warning: Comparable#== will no more rescue exceptions of #<=> in the next release.
/usr/local/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/laser-0.7.0.pre2/lib/laser/analysis/control_flow/static_single_assignment.rb:174: warning: Return nil in #<=> if the comparison is inappropriate or avoid such comparison.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.