From: Lukas Krickl Date: Wed, 3 Jan 2024 20:41:47 +0000 (+0100) Subject: Fixed segfault. TODO: macros do not expand strings properly X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=dbc18f4cb01c3fbd169bca961e2c4d797f4974b8;p=ulas%2F.git Fixed segfault. TODO: macros do not expand strings properly --- diff --git a/src/ulas.c b/src/ulas.c index 73e8c28..e856721 100644 --- a/src/ulas.c +++ b/src/ulas.c @@ -2473,6 +2473,10 @@ int ulas_asmdirstr(FILE *dst, const char **line, unsigned long n, int *rc) { do { char *s = ulas_strexpr(line, n, rc); + if (!s || *rc != 0) { + *rc = -1; + return 0; + } long len = strlen(s); // apply char code map diff --git a/tests/t0.s b/tests/t0.s index 0609ee7..718063a 100644 --- a/tests/t0.s +++ b/tests/t0.s @@ -138,6 +138,7 @@ l3: .db 1 .db $10 .db $11 .db $12 +.str $13 #endmacro -testmacro 1, 2, 3, 4, 5, 6, 7, 8, 9, 61, 62, 63 +testmacro 1, 2, 3, 4, 5, 6, 7, 8, 9, 61, 62, 63, "test"