aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/WasmObjectFile.cpp
diff options
context:
space:
mode:
authorPeter Klausler <35819229+klausler@users.noreply.github.com>2024-01-02 08:54:10 -0800
committerGitHub <noreply@github.com>2024-01-02 08:54:10 -0800
commit3bbdbb22a50705a78ea2668d4ab227889cabdc84 (patch)
tree9ac00aade74432a218239b50d535603d1caa10cc /llvm/lib/Object/WasmObjectFile.cpp
parent120ad2508af8b5093f5d9d9f5e7566936320e769 (diff)
downloadllvm-3bbdbb22a50705a78ea2668d4ab227889cabdc84.zip
llvm-3bbdbb22a50705a78ea2668d4ab227889cabdc84.tar.gz
llvm-3bbdbb22a50705a78ea2668d4ab227889cabdc84.tar.bz2
[flang] Fix parsing time explosion (#76533)
When parsing a deeply-nested expression like A1(A2(A3(A4(A5(A6(...A99(i)...)))))) the parser can get into an exponential state due to the need to consider the possibility that each "An(...)" might be the beginning of a reference to a procedure component ("An(...)%PROC(...)") so that alternative has to be attempted first before proceeding to try parsing "An(...)" as a function reference or as an array element designator. The parser for a structure component, which is used by the procedure designator parser, was not protected with the usual failure memoization technique, leading to exponentially bad behavior parsing a deeply-nested expression. Fix by exploiting the instrumented() parser combinator so that failed structure component parsers aren't repeated. Fixes https://github.com/llvm/llvm-project/issues/76477.
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions