]> granicus.if.org Git - yasm/commitdiff
Fixed nasty bug in error handling. It should have been setting the return
authorPeter Johnson <peter@tortall.net>
Mon, 24 Sep 2001 07:41:21 +0000 (07:41 -0000)
committerPeter Johnson <peter@tortall.net>
Mon, 24 Sep 2001 07:41:21 +0000 (07:41 -0000)
bytecode value to NULL on error, but wasn't (random return value is bad!).

svn path=/trunk/yasm/; revision=221

modules/parsers/nasm/gen_instr.pl
src/parsers/nasm/gen_instr.pl

index 3561a3e8ac405d4b65fdda223e9bf6bd65d9bb81..5b933de43987262ae58eef974840db85110ae86a 100755 (executable)
@@ -810,6 +810,7 @@ sub output_yacc ($@)
                # ASSUMES: at least one previous action exists
                print GRAMMAR "    | \Ugrp_$group\E error {\n";
                print GRAMMAR "        Error (_(\"expression syntax error\"));\n";
+               print GRAMMAR "        \$\$ = (bytecode *)NULL\n";
                print GRAMMAR "    }\n";
 
                # terminate the rule
index 3561a3e8ac405d4b65fdda223e9bf6bd65d9bb81..5b933de43987262ae58eef974840db85110ae86a 100755 (executable)
@@ -810,6 +810,7 @@ sub output_yacc ($@)
                # ASSUMES: at least one previous action exists
                print GRAMMAR "    | \Ugrp_$group\E error {\n";
                print GRAMMAR "        Error (_(\"expression syntax error\"));\n";
+               print GRAMMAR "        \$\$ = (bytecode *)NULL\n";
                print GRAMMAR "    }\n";
 
                # terminate the rule