================
@@ -1432,14 +1432,26 @@ void 
NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) {
     Diags.Report(TokLoc, DiagId);
     ++s;
     DigitsBegin = s;
-    SawOctalPrefix = true;
+    radix = 8;
----------------
naveen-seth wrote:

I don't think the octal digits are skipped twice here, because the function now 
always returns before exiting the if-block we are currently in.
https://github.com/llvm/llvm-project/blob/8556e25c43fff5525501113f38dc0f3b48203f5c/clang/lib/Lex/LiteralSupport.cpp#L1447-L1448
This separates parsing for octals with a literal prefix from those starting 
with `0`, so that the logic for potentially parsing a floating-point only 
applies to the latter (otherwise, we get this crash).
Let me know if I am missing something here!

For the `radix` assignment, this could be shared between both cases if we move 
it above the current if statement.

https://github.com/llvm/llvm-project/pull/141695
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to