Skip to content

SEGV in error handling of command line parameters #128

Open
@srowe

Description

@srowe

Trying to define a macro on the command line as follows:

dasm firmware.asm -ofirmware.bin -DFW_VERSION=1.aa -f3 -S -sfirmware.sym

results in:

Program received signal SIGSEGV, Segmentation fault.
asmerr (err=6, bAbort=false, sText=0x7fffffffddf4 "1.aa") at main.c:1578
1578    main.c: No such file or directory.
(gdb) where
#0  asmerr (err=6, bAbort=false, sText=0x7fffffffddf4 "1.aa") at main.c:1578
#1  0x0000000000409fac in eval (str=0x7fffffffddf8 "", wantmode=0) at exp.c:575
#2  0x0000000000407dca in v_set (str=0x7fffffffddf4 "1.aa", dummy=0x0) at ops.c:1232
#3  0x0000000000401fa8 in MainShadow (ac=7, av=0x7fffffffd948, pbTableSort=0x7fffffffd84b) at main.c:490
#4  0x0000000000404cde in main (ac=7, av=0x7fffffffd948) at main.c:1747

This seems to be as a result of bStopAtEnd being NULL

(gdb) print err
$1 = 6
(gdb) print bStopAtEnd
$2 = (_Bool *) 0x0

it is malloc()after command line arguments are processed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions