Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add forgotten UpdateExceptionVariables transformation.

  • Loading branch information...
commit 748090fd4186f66a635e0c33c53337f666901b64 1 parent bb5f5dc
@whitequark authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 lib/furnace-avm2/transform/update_exception_variables.rb
View
21 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
Please sign in to comment.
Something went wrong with that request. Please try again.