projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
459319a
)
Fix emission of string initializers.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Wed, 17 Aug 2011 13:44:43 +0000
(15:44 +0200)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Wed, 17 Aug 2011 14:42:05 +0000
(16:42 +0200)
Non-printable characters are emitted as octal sequences, e.g. \0 for 0.
Always pad them to three digits, so they do not accidently join with a following ASCII digit.
E.g. "\0""7" was emitted as "\07", correct is "\0007".
ir/be/begnuas.c
patch
|
blob
|
history
diff --git
a/ir/be/begnuas.c
b/ir/be/begnuas.c
index
72b46aa
..
1fc3f31
100644
(file)
--- a/
ir/be/begnuas.c
+++ b/
ir/be/begnuas.c
@@
-884,7
+884,7
@@
static void emit_string_cst(const ir_entity *ent)
if (isprint(c))
be_emit_char(c);
else
- be_emit_irprintf("\\%o", c);
+ be_emit_irprintf("\\%
03
o", c);
break;
}
}
@@
-929,7
+929,7
@@
static size_t emit_string_initializer(const ir_initializer_t *initializer)
if (isprint(c))
be_emit_char(c);
else
- be_emit_irprintf("\\%o", c);
+ be_emit_irprintf("\\%
03
o", c);
break;
}
}