projects
/
mes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ce3233f
)
mescc: Tinycc support: sizeof ("foo").
author
Jan Nieuwenhuizen
<janneke@gnu.org>
Sun, 23 Jul 2017 11:56:38 +0000
(13:56 +0200)
committer
Jan Nieuwenhuizen
<janneke@gnu.org>
Wed, 26 Jul 2017 09:36:08 +0000
(11:36 +0200)
* module/language/c99/compiler.mes (expr->accu): Support sizeof (string).
module/language/c99/compiler.mes
patch
|
blob
|
history
diff --git
a/module/language/c99/compiler.mes
b/module/language/c99/compiler.mes
index 07c77c96207aaed2c51f0170aa3af530ebd4ad2a..e8d666dc11ec9cc89dcf8661812e0d9c47fcf6b3 100644
(file)
--- a/
module/language/c99/compiler.mes
+++ b/
module/language/c99/compiler.mes
@@
-518,6
+518,9
@@
(size (ast-type->size info type)))
(append-text info (wrap-as (i386:value->accu size)))))
+ ((sizeof-expr (p-expr (string ,string)))
+ (append-text info (wrap-as (i386:value->accu (1+ (string-length string))))))
+
((sizeof-expr (i-sel (ident ,field) (p-expr (ident ,array))))
(let* ((type (ident->type info array))
(size (field-size info type field)))