projects
/
ulas
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
24d6839
)
Fixed segfault. TODO: macros do not expand strings properly
author
Lukas Krickl
<lukas@krickl.dev>
Wed, 3 Jan 2024 20:41:47 +0000
(21:41 +0100)
committer
Lukas Krickl
<lukas@krickl.dev>
Wed, 3 Jan 2024 20:41:47 +0000
(21:41 +0100)
src/ulas.c
patch
|
blob
|
history
tests/t0.s
patch
|
blob
|
history
diff --git
a/src/ulas.c
b/src/ulas.c
index 73e8c28025b00fb8d9f4be46c42ef9f75d246bee..e85672115ae3fa0b9006a0bd518d306c40323a4e 100644
(file)
--- 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 0609ee72fdb974b17493bd879f919e589ca127a8..718063aca0c5a4fb60e5a761972c3b9d1f26f06e 100644
(file)
--- 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"