summaryrefslogtreecommitdiff
path: root/gcc/c-pragma.c
diff options
context:
space:
mode:
authordannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-14 21:41:40 +0000
committerdannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-14 21:41:40 +0000
commitb8989bc3c103034ae5f48e69e44b0a176004996c (patch)
treecdaa87661a8e9905d3600ff02fe3ca6acec3909b /gcc/c-pragma.c
parent662f56bd3d43c3251a0679c42cce915ec0488fd5 (diff)
downloadgcc-b8989bc3c103034ae5f48e69e44b0a176004996c.tar.gz
PR preprocessor/35061
gcc * c-pragma.c (handle_pragma_pop_macro): Check that pushed_macro_table has been allocated. testsuite * gcc.dg/cpp/pragma_pop_macro-1.c: New file git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132322 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pragma.c')
-rw-r--r--gcc/c-pragma.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index 28b44353b22..f7da67622ce 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -341,7 +341,7 @@ handle_pragma_pop_macro (cpp_reader *reader)
enum cpp_ttype token;
struct def_pragma_macro dummy, *c;
const char *macroname;
- void **slot;
+ void **slot = NULL;
if (pragma_lex (&x) != CPP_OPEN_PAREN)
GCC_BAD ("missing %<(%> after %<#pragma pop_macro%> - ignored");
@@ -367,8 +367,9 @@ handle_pragma_pop_macro (cpp_reader *reader)
dummy.hash = htab_hash_string (macroname);
dummy.name = macroname;
- slot = htab_find_slot_with_hash (pushed_macro_table, &dummy,
- dummy.hash, NO_INSERT);
+ if (pushed_macro_table)
+ slot = htab_find_slot_with_hash (pushed_macro_table, &dummy,
+ dummy.hash, NO_INSERT);
if (slot == NULL)
return;
c = *slot;