Merge pull request #579 from skandhas/pr-remove-incorrect-pop-in-codegen

remove incorrect pop() call  in codegen
This commit is contained in:
Yukihiro "Matz" Matsumoto
2012-11-30 19:12:09 -08:00
2 changed files with 11 additions and 1 deletions
-1
View File
@@ -1412,7 +1412,6 @@ codegen(codegen_scope *s, node *tree, int val)
codegen(s, tree->cdr->cdr->car, VAL);
pop();
gen_assignment(s, tree->car, cursp(), val);
if (val) pop();
dispatch(s, pos);
break;
}
+11
View File
@@ -58,3 +58,14 @@ assert('Nested const reference') do
Syntax4Const::CONST1 == "hello world" and
Syntax4Const::Const2.new.const1 == "hello world"
end
assert('Abbreviated variable assignment as returns') do
module Syntax4AbbrVarAsgnAsReturns
class A
def b
@c ||= 1
end
end
end
Syntax4AbbrVarAsgnAsReturns::A.new.b == 1
end