ValhallaTeam / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Add options to check for expression complexity and call stack depth #423

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We need to be able to limit expression complexity and call stack depth to 
prevent certain driver's from having a stack overflow while compiling shaders.

Where is the best place to do this?

As a first pass I added a maxDepth IIntermTraverser which seems to be enough to 
check expression complexity.

As for function call stack depth, I saw there is a DetectRecursion which seems 
like a similar feature. Should I modify that or create something new? Checking 
the call stack requires checking all functions, not just "main(" because the 
driver might compile all functions even if it doesn't use them and it's the 
compile stage that's failing.

Thoughts?

Original issue reported on code.google.com by g...@chromium.org on 10 May 2013 at 5:58

GoogleCodeExporter commented 9 years ago
cc'ing Nicolas

Original comment by shannonw...@google.com on 10 May 2013 at 6:19

GoogleCodeExporter commented 9 years ago
Indeed it seems like a good idea to check the call stack depth in 
DetectRecursion. Unlike other validations it is always run, since recursion is 
not allowed by the language spec at all.

I'd suggest to actually perform dead function elimination. We recently ran into 
a minor issue where uniforms were considered active even though they're only 
used in functions that aren't called. Eliminating these functions would fix 
these issues.

Original comment by nicolas....@gmail.com on 13 May 2013 at 2:07

GoogleCodeExporter commented 9 years ago

Original comment by geofflang@chromium.org on 28 Oct 2013 at 6:59

GoogleCodeExporter commented 9 years ago

Original comment by geofflang@chromium.org on 28 Oct 2013 at 6:59

GoogleCodeExporter commented 9 years ago

Original comment by c...@chromium.org on 7 Dec 2013 at 4:11

GoogleCodeExporter commented 9 years ago
Was fixed in eb1a010f0f996b3742fd34b92ffaf9014c943528 "Add expression 
complexity and call stack depth limits".

Original comment by c...@chromium.org on 21 May 2014 at 7:39