Skip to content

Commit

Permalink
GP-3541 Fixed pragma parsing with embedded comma outside of parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
emteere committed Jun 12, 2023
1 parent 3b62fda commit 6d428e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,7 @@ void PragmaSpecifier() : {
{
LOOKAHEAD(3)
<POPEN> PragmaSpecifier() <PCLOSE> |
id=<PIDENTIFIER> (<PIDENTIFIER> | <PINTEGER_LITERAL> | <PSTRING_LITERAL>)*
id=<PIDENTIFIER> (<PIDENTIFIER> | <PINTEGER_LITERAL> | <PSTRING_LITERAL> | <PCOMMA> )*
([ <POPEN> [ (ds1=PragmaConstant())+ [ ( <PCOMMA> ds2=PragmaConstant() ) [ ( <PCOMMA> ds3=PragmaConstant() ) [ ( <PCOMMA> PragmaConstant() )+ ] ] ] ] <PCLOSE> ] )
{
if (id.image.equals("pack") && ds1 != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ int (__stdcall * GetSectionBlock) (

#pragma region Input compatibility macros

// nothing will parse after this line if the this fails
#pragma test for, pragma, with, commas outside parens

#pragma warning(disable)

#pragma warning(disable:4035 4793) // re-enable below
Expand Down

0 comments on commit 6d428e0

Please sign in to comment.