Permalink
Browse files

Added a missed file: guaranteed super detection.

  • Loading branch information...
1 parent 59226dc commit d0a421d35c7eac6f136da32c589c31961b26a5da Michael Edgar committed Aug 27, 2011
Showing with 21 additions and 0 deletions.
  1. +21 −0 lib/laser/analysis/control_flow/guaranteed_super_detection.rb
View
21 lib/laser/analysis/control_flow/guaranteed_super_detection.rb
@@ -0,0 +1,21 @@
+module Laser
+ module Analysis
+ module ControlFlow
+ module GuaranteedSuperDetection
+ def guaranteed_super_on_success?
+ tree = dominator_tree
+ success_block = tree[return_postdominator]
+ check_block = success_block
+ while check_block
+ has_super = check_block.instructions.any? do |insn|
+ insn.type == :super || insn.type == :super_vararg
+ end
+ return true if has_super
+ check_block = check_block.successors.first
+ end
+ false
+ end
+ end
+ end
+ end
+end

0 comments on commit d0a421d

Please sign in to comment.