diff options
author | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-18 10:08:22 +0000 |
---|---|---|
committer | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-18 10:08:22 +0000 |
commit | 6e890d9c086616f7df19581e82b1a5818a55d051 (patch) | |
tree | 3d17b916a205737a2d3169bbb5685b59b41c28ad /gcc/c-pragma.c | |
parent | 83852912b2d36f3a51414a39a80fd51f8aa3e1e1 (diff) | |
download | gcc-6e890d9c086616f7df19581e82b1a5818a55d051.tar.gz |
PR c/28286
* c-pragma.c (handle_pragma_pack): Handle invalid constants.
* gcc.dg/pragma-pack-4.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115548 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pragma.c')
-rw-r--r-- | gcc/c-pragma.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c index e71ab07a16f..b2712acc937 100644 --- a/gcc/c-pragma.c +++ b/gcc/c-pragma.c @@ -160,6 +160,8 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy)) } else if (token == CPP_NUMBER) { + if (TREE_CODE (x) != INTEGER_CST) + GCC_BAD ("invalid constant in %<#pragma pack%> - ignored"); align = TREE_INT_CST_LOW (x); action = set; if (pragma_lex (&x) != CPP_CLOSE_PAREN) @@ -190,6 +192,8 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy)) } else if (token == CPP_NUMBER && action == push && align == -1) { + if (TREE_CODE (x) != INTEGER_CST) + GCC_BAD ("invalid constant in %<#pragma pack%> - ignored"); align = TREE_INT_CST_LOW (x); if (align == -1) action = set; |