diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-11-18 15:47:35 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-11-18 15:47:35 +0000 |
commit | a09dc31d1f5b871705115bdc1984ce8e4f4c22f5 (patch) | |
tree | f1741bce4ecc9467305c75925e999332b5c9f174 /scope.h | |
parent | f2b88940d815760ad254d35a0ee1eb2ed8ce7762 (diff) | |
download | perl-a09dc31d1f5b871705115bdc1984ce8e4f4c22f5.tar.gz |
Skip the scope name checks if PL_scopestack_name is NULL.
It's possible that someone has built a module with -DDEBUGGING, but they're
using it against a perl built non-DEBUGGING, in which case PL_scopestack_name
will be NULL. Better to skip the checks than to SEGV.
Diffstat (limited to 'scope.h')
-rw-r--r-- | scope.h | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -134,15 +134,18 @@ scope has the given name. Name must be a literal string. #define ENTER_with_name(name) \ STMT_START { \ push_scope(); \ - PL_scopestack_name[PL_scopestack_ix-1] = name; \ + if (PL_scopestack_name) \ + PL_scopestack_name[PL_scopestack_ix-1] = name; \ DEBUG_SCOPE("ENTER \"" name "\"") \ } STMT_END #define LEAVE_with_name(name) \ STMT_START { \ DEBUG_SCOPE("LEAVE \"" name "\"") \ - assert(((char*)PL_scopestack_name[PL_scopestack_ix-1] \ - == (char*)name) \ - || strEQ(PL_scopestack_name[PL_scopestack_ix-1], name)); \ + if (PL_scopestack_name) { \ + assert(((char*)PL_scopestack_name[PL_scopestack_ix-1] \ + == (char*)name) \ + || strEQ(PL_scopestack_name[PL_scopestack_ix-1], name)); \ + } \ pop_scope(); \ } STMT_END #else |