Issue 8644 in angleproject: Deeply nested iterator declarations can crash

1 view
Skip to first unread message

msc… via monorail

unread,
Apr 2, 2024, 11:42:59 AM4/2/24
to angleproj...@googlegroups.com
Status: Untriaged
Owner: ----
Priority: Medium
Type: Defect

New issue 8644 by msc...@apple.com: Deeply nested iterator declarations can crash
https://bugs.chromium.org/p/angleproject/issues/detail?id=8644

TEST_F(ParseTest, DeeplyNestedWhileExpressionsNoCrash)
{
mShaderSpec = SH_WEBGL2_SPEC;
std::ostringstream shader;
shader << R"(#version 300 es
int counter() {
)";
for (int i = 0; i < 1700; ++i)
{
shader << " while(true)";
}
shader << " ; return 0; }";
EXPECT_FALSE(compile(shader.str()));
EXPECT_TRUE(foundErrorInIntermediateTree());
EXPECT_TRUE(foundInIntermediateTree("expression is too deeply nested"));
}

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Git Watcher via monorail

unread,
May 9, 2024, 11:07:11 AM5/9/24
to angleproj...@googlegroups.com

Comment #1 on issue 8644 by Git Watcher: Deeply nested iterator declarations can crash
https://bugs.chromium.org/p/angleproject/issues/detail?id=8644#c1

The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/2ecfc5a1c29357c6e16555298771cc4d68f20d90

commit 2ecfc5a1c29357c6e16555298771cc4d68f20d90
Author: Scott Marcy <msc...@apple.com>
Date: Sat May 04 00:29:12 2024

Issue 8644: Deeply nested iterator declarations can crash

Avoid stack overflow crash when parsing nested iterators (especially
`while` statements).

Limits the number of nested iterator statements to `mMaxStatementDepth`
(defaults to 256).

Bug: angleproject:8644
Change-Id: I9b0fd2ab456c3cdd731b41ab97f495ae4dc0b0bb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5519169
Commit-Queue: Geoff Lang <geof...@chromium.org>
Reviewed-by: Kimmo Kinnunen <kkin...@apple.com>
Auto-Submit: Scott M <msc...@apple.com>

[modify] https://crrev.com/2ecfc5a1c29357c6e16555298771cc4d68f20d90/scripts/code_generation_hashes/ANGLE_shader_translator.json
[modify] https://crrev.com/2ecfc5a1c29357c6e16555298771cc4d68f20d90/src/compiler/translator/ParseContext.cpp
[modify] https://crrev.com/2ecfc5a1c29357c6e16555298771cc4d68f20d90/src/compiler/translator/glslang.y
[modify] https://crrev.com/2ecfc5a1c29357c6e16555298771cc4d68f20d90/src/compiler/translator/ParseContext.h
[modify] https://crrev.com/2ecfc5a1c29357c6e16555298771cc4d68f20d90/src/tests/compiler_tests/Parse_test.cpp
[modify] https://crrev.com/2ecfc5a1c29357c6e16555298771cc4d68f20d90/src/compiler/translator/glslang_tab_autogen.cpp
[modify] https://crrev.com/2ecfc5a1c29357c6e16555298771cc4d68f20d90/src/compiler/translator/ShaderLang.cpp
[modify] https://crrev.com/2ecfc5a1c29357c6e16555298771cc4d68f20d90/src/compiler/translator/Compiler.cpp
[modify] https://crrev.com/2ecfc5a1c29357c6e16555298771cc4d68f20d90/include/GLSLANG/ShaderLang.h
Reply all
Reply to author
Forward
0 new messages