Permalink
Browse files

Add forgotten UpdateExceptionVariables transformation.

  • Loading branch information...
1 parent bb5f5dc commit 748090fd4186f66a635e0c33c53337f666901b64 @whitequark committed Aug 18, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 lib/furnace-avm2/transform/update_exception_variables.rb
@@ -0,0 +1,21 @@
+module Furnace::AVM2
+ module Transform
+ class UpdateExceptionVariables
+ def transform(cfg)
+ cfg.nodes.each do |block|
+ if block.metadata[:exception]
+ block.cti.children.each do |catch|
+ error, variable, target = catch.children
+ target_block = cfg.find_node target
+ target_block.metadata.gets_map[block.label].each do |node|
+ node.update(:exception_variable, [ variable ])
+ end
+ end
+ end
+ end
+
+ cfg
+ end
+ end
+ end
+end

0 comments on commit 748090f

Please sign in to comment.