From: Nicholas Clark Date: Wed, 18 Nov 2009 15:47:35 +0000 (+0000) Subject: Skip the scope name checks if PL_scopestack_name is NULL. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a09dc31d1;p=p5sagit%2Fp5-mst-13.2.git 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. --- diff --git a/scope.h b/scope.h index 2f50398..64e7e27 100644 --- a/scope.h +++ b/scope.h @@ -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