aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2025-07-09 15:31:45 +0100
committerGitHub <noreply@github.com>2025-07-09 15:31:45 +0100
commitd0caf0d4857c2b00ba988f86703663685ec8697f (patch)
tree259284b0c9f7d59ab2e2cdb93a368a23915366b9 /flang/lib/Frontend/CompilerInvocation.cpp
parent18ea6fcb23ff77362008a8e1ae8671d5d6f019fe (diff)
downloadllvm-d0caf0d4857c2b00ba988f86703663685ec8697f.zip
llvm-d0caf0d4857c2b00ba988f86703663685ec8697f.tar.gz
llvm-d0caf0d4857c2b00ba988f86703663685ec8697f.tar.bz2
[flang] Avoid undefined behaviour when parsing format expressions (#147539)
The test flang/test/Semantics/io08.f90 was failing when UBSAN was enabled: ``` /home/david.spickett/llvm-project/flang/include/flang/Common/format.h:224:26: runtime error: signed integer overflow: 10 * 987654321098765432 cannot be represented in type 'int64_t' (aka 'long') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/david.spickett/llvm-project/flang/include/flang/Common/format.h:224:26 ``` This is because the code was effectively: * Take the risk of UB happening * Check whether it happened or not Which UBSAN is obviously not going to like. Instead of checking after the fact, use llvm's helpers that catch overflow without actually doing it.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions