So, the patch may be changing the assertion from "assert(currentChar == '+' || currentChar == '-');" to "assert(currentChar == '+' || currentChar == '-' || currentChar == '?');"
I do not meet any problem since then.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I traced into the souce code and found that in ASFormatter::updateFormattedLineSplitPointsOperator, line 6943.
The code has a possiblity to trigger the assert. You can see the third condition is "?".
It's related to some configuration item of Astyle. I can't reproduce it with different config. Will try to narrow down.
However, based on the code snippet listed above. It's definitely an bug.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Related config
The "currentChar" is '?' and charNum >= 2 is OK.
So, the patch may be changing the assertion from "assert(currentChar == '+' || currentChar == '-');" to "assert(currentChar == '+' || currentChar == '-' || currentChar == '?');"
I do not meet any problem since then.
I can't reproduce this error.
This function should not be called for a "?".
Send the few lines causing the problam encloced in a function.
I tried to simplify the string, eg. ") ? _(". and reproduced the crash.
The call stack is:
I traced into the souce code and found that in ASFormatter::updateFormattedLineSplitPointsOperator, line 6943.
The code has a possiblity to trigger the assert. You can see the third condition is "?".
else if (sequence == "+" || sequence == "-" || sequence == "?")
{
if (charNum > 0
&& !isInExponent()
&& (isLegalNameChar(currentLine[charNum - 1])
This is the root cause.
Works OK.
Can you explain more? It would definitely cause crash at the line mentioned if sequence == "?", charNum >0 and currentChar == '?'.
It's related to some configuration item of Astyle. I can't reproduce it with different config. Will try to narrow down.
However, based on the code snippet listed above. It's definitely an bug.