Skip to content
Browse files

Correctly handle nops.

  • Loading branch information...
1 parent 069bb3c commit 6275dfcabd58e8b99f25e885e9a7572347e6f150 @whitequark committed Apr 12, 2012
Showing with 6 additions and 5 deletions.
  1. +2 −5 lib/furnace-avm2/source/decompiler.rb
  2. +4 −0 lib/furnace-avm2/transform/nf_normalize.rb
View
7 lib/furnace-avm2/source/decompiler.rb
@@ -99,10 +99,6 @@ def stmt_push_scope(opcode, nodes)
end
end
- def stmt_nop(opcode, nodes)
- # ignore
- end
-
def stmt_if(opcode, nodes)
condition, if_true, if_false = opcode.children
@@ -293,7 +289,8 @@ def expr_set_var(name, value, declare)
token(ImmediateTypenameToken, IMMEDIATE_TYPE_MAP[value.type])
])
elsif value.type == :coerce || value.type == :convert
- type = type_token(value.children.first)
+ type = type_token(value.children.first)
+ value = value.children.last
else
type = nil
end
View
4 lib/furnace-avm2/transform/nf_normalize.rb
@@ -18,6 +18,10 @@ def remove_useless_return
end
end
+ def on_nop(node)
+ node.update(:remove)
+ end
+
COERCE_MAP = {
:coerce_a => :any,
:coerce_b => :bool,

0 comments on commit 6275dfc

Please sign in to comment.
Something went wrong with that request. Please try again.