commit | 782dbebf9edc9a3f122a1fc6c58fb3762689cff7 | [log] [tgz] |
---|---|---|
author | Nicolas Capens <capn@google.com> | Fri Oct 30 14:17:00 2020 -0400 |
committer | Nicolas Capens <nicolascapens@google.com> | Mon Nov 02 16:42:36 2020 +0000 |
tree | 9ad2572bb013b093f8c51f5dd778c69a7294a9d6 | |
parent | b0e426fcf95534d1bbba97b046437bbdf3cfd5b4 [diff] |
Prevent 'most vexing parse' issue A statement like "If(Bool(b)) {}" would lead to interpreting part of its maco expansion "IfElseData ifElse__(Bool(b));" as a function declaration. See https://en.wikipedia.org/wiki/Most_vexing_parse Fix it by using C++11 universal initialization syntax. Bug: b/155148722 Change-Id: I64d0a28f64a4735a61776a44dfb7560d2854cde3 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49808 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com> Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Reactor/Reactor.hpp b/src/Reactor/Reactor.hpp index b943920..1e08698 100644 --- a/src/Reactor/Reactor.hpp +++ b/src/Reactor/Reactor.hpp
@@ -3503,8 +3503,8 @@ IFELSE_NUM__ }; -#define If(cond) \ - for(IfElseData ifElse__(cond); ifElse__ < IFELSE_NUM__; ++ifElse__) \ +#define If(cond) \ + for(IfElseData ifElse__{ cond }; ifElse__ < IFELSE_NUM__; ++ifElse__) \ if(ifElse__ == IF_BLOCK__) #define Else \