]> granicus.if.org Git - yasm/commitdiff
Fix a major bug: after switching sections, prev_bc was always being set to
authorPeter Johnson <peter@tortall.net>
Thu, 3 Oct 2002 09:26:47 +0000 (09:26 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 3 Oct 2002 09:26:47 +0000 (09:26 -0000)
NULL, causing any labels at that point to point to the start of the section
instead of the current position!

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

modules/parsers/nasm/nasm-bison.y
src/parsers/nasm/nasm-bison.y

index d2cfd55d0240043d2cea6235b0a0300555eeefe5..3a7bd67d49f9ec447e70c1a1e69b4f714edf7d2d 100644 (file)
@@ -546,7 +546,7 @@ nasm_parser_directive(const char *name, valparamhead *valparams,
                                        objext_valparams);
        if (new_section) {
            nasm_parser_cur_section = new_section;
-           nasm_parser_prev_bc = (bytecode *)NULL;
+           nasm_parser_prev_bc = bcs_last(section_get_bytecodes(new_section));
        } else
            Error(_("invalid argument to [%s]"), "SECTION");
     } else if (strcasecmp(name, "absolute") == 0) {
index d2cfd55d0240043d2cea6235b0a0300555eeefe5..3a7bd67d49f9ec447e70c1a1e69b4f714edf7d2d 100644 (file)
@@ -546,7 +546,7 @@ nasm_parser_directive(const char *name, valparamhead *valparams,
                                        objext_valparams);
        if (new_section) {
            nasm_parser_cur_section = new_section;
-           nasm_parser_prev_bc = (bytecode *)NULL;
+           nasm_parser_prev_bc = bcs_last(section_get_bytecodes(new_section));
        } else
            Error(_("invalid argument to [%s]"), "SECTION");
     } else if (strcasecmp(name, "absolute") == 0) {