projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
aca9e31
)
allow empty initializers
author
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Thu, 6 Mar 2008 14:01:03 +0000
(14:01 +0000)
committer
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Thu, 6 Mar 2008 14:01:03 +0000
(14:01 +0000)
[r17973]
ir/be/begnuas.c
patch
|
blob
|
history
diff --git
a/ir/be/begnuas.c
b/ir/be/begnuas.c
index
b0bf564
..
b848679
100644
(file)
--- a/
ir/be/begnuas.c
+++ b/
ir/be/begnuas.c
@@
-420,6
+420,8
@@
static int initializer_is_string_const(const ir_initializer_t *initializer)
return 0;
len = initializer->compound.n_initializers;
return 0;
len = initializer->compound.n_initializers;
+ if (len < 1)
+ return 0;
for(i = 0; i < len; ++i) {
int c;
tarval *tv;
for(i = 0; i < len; ++i) {
int c;
tarval *tv;
@@
-438,9
+440,13
@@
static int initializer_is_string_const(const ir_initializer_t *initializer)
return 0;
c = get_tarval_long(tv);
return 0;
c = get_tarval_long(tv);
- if((i < len - 1 && !(isgraph(c) || isspace(c)))
- || (i >= len - 1 && c != 0))
- return 0;
+ if (i < len - 1) {
+ if (!isgraph(c) && !isspace(c))
+ return 0;
+ } else {
+ if (c != 0)
+ return 0;
+ }
}
return 1;
}
return 1;
@@
-809,6
+815,9
@@
static void dump_initializer(be_gas_decl_env_t *env, obstack_t *obst,
type = get_entity_type(entity);
size = get_initializer_size(initializer, type);
type = get_entity_type(entity);
size = get_initializer_size(initializer, type);
+ if (size == 0)
+ return;
+
/*
* In the worst case, every initializer allocates one byte.
* Moreover, initializer might be big, do not allocate on stack.
/*
* In the worst case, every initializer allocates one byte.
* Moreover, initializer might be big, do not allocate on stack.