Revise recent adaptations to frontend refactorings

This commit is contained in:
Martin Kinkelin 2020-01-06 16:13:27 +01:00
parent a3efe6d89c
commit 1f5c442519
10 changed files with 76 additions and 93 deletions

View file

@ -28,8 +28,11 @@ bool parseStringExp(Expression *e, const char *&res) {
if (e->op != TOKstring) {
return false;
}
auto s = static_cast<StringExp *>(e);
res = s->toStringz();
auto se = static_cast<StringExp *>(e);
auto size = (se->len + 1) * se->sz;
auto s = static_cast<char *>(mem.xmalloc(size));
se->writeTo(s, true);
res = s;
return true;
}