diff options
author | Karl Williamson <khw@cpan.org> | 2022-03-02 11:08:58 -0700 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2022-03-03 02:42:27 +0100 |
commit | ca0572d7d359fdfdcdfa2ef0624fe9b9da3af2d6 (patch) | |
tree | cd938dc4e8292e1aa2e973137e1ca257e7d49af9 /scope.h | |
parent | 198c4f174582886fed1dd36610fff68fbe836c8e (diff) | |
download | perl-ca0572d7d359fdfdcdfa2ef0624fe9b9da3af2d6.tar.gz |
Add 'ASSERT_IS_LITERAL' macro
This is intended to make it obvious what this relatively obscure C
construct is doing.
Diffstat (limited to 'scope.h')
-rw-r--r-- | scope.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -201,7 +201,7 @@ scope has the given name. C<name> must be a literal string. STMT_START { \ push_scope(); \ if (PL_scopestack_name) \ - PL_scopestack_name[PL_scopestack_ix-1] = name; \ + PL_scopestack_name[PL_scopestack_ix-1] = ASSERT_IS_LITERAL(name);\ DEBUG_SCOPE("ENTER \"" name "\"") \ } STMT_END #define LEAVE_with_name(name) \ @@ -210,7 +210,7 @@ scope has the given name. C<name> must be a literal string. if (PL_scopestack_name) { \ CLANG_DIAG_IGNORE_STMT(-Wstring-compare); \ assert(((char*)PL_scopestack_name[PL_scopestack_ix-1] \ - == (char*)name) \ + == (char*)ASSERT_IS_LITERAL(name)) \ || strEQ(PL_scopestack_name[PL_scopestack_ix-1], name)); \ CLANG_DIAG_RESTORE_STMT; \ } \ |