]> granicus.if.org Git - yasm/commitdiff
Fix bad valparams setup introduced in previous commit. yasm_vps_append()
authorPeter Johnson <peter@tortall.net>
Sun, 17 Dec 2006 18:11:00 +0000 (18:11 -0000)
committerPeter Johnson <peter@tortall.net>
Sun, 17 Dec 2006 18:11:00 +0000 (18:11 -0000)
is a macro and does bad things when given a non-variable.

Tracked down by: Peter Tanski <p.tanski@gmail.com>

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

modules/objfmts/coff/coff-objfmt.c
modules/objfmts/elf/elf-objfmt.c

index 9b0bb5c93be1a1a00d2b1bdef14f7781c6ff46a0..5de250ce05ae0d7ac797c29eea3cdc0381d2c6b5 100644 (file)
@@ -1742,6 +1742,7 @@ win32_objfmt_directive(yasm_objfmt *objfmt, const char *name,
        yasm_datavalhead dvs;
        yasm_section *comment;
        const char *sectname;
+       yasm_valparam *vp2;
 
        if (objfmt_coff->win32) {
            /* Put ident data into .comment section for COFF, or .rdata$zzz
@@ -1753,8 +1754,8 @@ win32_objfmt_directive(yasm_objfmt *objfmt, const char *name,
            sectname = ".comment";
        }
        yasm_vps_initialize(&sect_vps);
-       yasm_vps_append(&sect_vps,
-                       yasm_vp_create(yasm__xstrdup(sectname), NULL));
+       vp2 = yasm_vp_create(yasm__xstrdup(sectname), NULL);
+       yasm_vps_append(&sect_vps, vp2);
        comment = coff_objfmt_section_switch(objfmt, &sect_vps, NULL, line);
        yasm_vps_delete(&sect_vps);
 
index 782fd624a2cede3954a16925f3c4ff598d83551b..d570a9d6af03ef5277c3c6dc5dc59ddc19853600 100644 (file)
@@ -1174,11 +1174,12 @@ elf_objfmt_directive(yasm_objfmt *objfmt, const char *name,
        yasm_valparamhead sect_vps;
        yasm_datavalhead dvs;
        yasm_section *comment;
+       yasm_valparam *vp2;
 
        /* Put ident data into .comment section */
        yasm_vps_initialize(&sect_vps);
-       yasm_vps_append(&sect_vps,
-                       yasm_vp_create(yasm__xstrdup(".comment"), NULL));
+       vp2 = yasm_vp_create(yasm__xstrdup(".comment"), NULL);
+       yasm_vps_append(&sect_vps, vp2);
        comment = elf_objfmt_section_switch(objfmt, &sect_vps, NULL, line);
        yasm_vps_delete(&sect_vps);