Both test, and if necessary spit out an error, to see if the node is really a 32-bit integer or can implicitly convert to one.
| 4242 | // a 32-bit integer or can implicitly convert to one. |
| 4243 | // |
| 4244 | void TParseContext::integerCheck(const TIntermTyped* node, const char* token) |
| 4245 | { |
| 4246 | auto from_type = node->getBasicType(); |
| 4247 | if ((from_type == EbtInt || from_type == EbtUint || |
| 4248 | intermediate.canImplicitlyPromote(from_type, EbtInt, EOpNull) || |
| 4249 | intermediate.canImplicitlyPromote(from_type, EbtUint, EOpNull)) && node->isScalar()) |
| 4250 | return; |
| 4251 | |
| 4252 | error(node->getLoc(), "scalar integer expression required", token, ""); |
| 4253 | } |
| 4254 | |
| 4255 | // |
| 4256 | // Both test, and if necessary spit out an error, to see if the node is really |
no test coverage detected