diff options
| -rw-r--r-- | memops.c | 2 | ||||
| -rw-r--r-- | validation/bug-bad-type.c | 18 |
2 files changed, 20 insertions, 0 deletions
@@ -160,6 +160,8 @@ static void kill_dominated_stores(struct basic_block *bb) pseudo_t pseudo = insn->src; int local; + if (!insn->type) + continue; if (insn->type->ctype.modifiers & MOD_VOLATILE) continue; diff --git a/validation/bug-bad-type.c b/validation/bug-bad-type.c new file mode 100644 index 00000000..0e00efef --- /dev/null +++ b/validation/bug-bad-type.c @@ -0,0 +1,18 @@ +struct s { + int i; +}; + +long a; +void foo(void) +{ + (struct s) { .i = (foo - a), }; +} + +/* + * check-name: bug-bad-type + * + * check-error-start +bug-bad-type.c:5:6: warning: symbol 'a' was not declared. Should it be static? +bug-bad-type.c:8:32: error: arithmetics on pointers to functions + * check-error-end + */ |
