| 1153 | } |
| 1154 | |
| 1155 | static bool isVLAIndex(const Token* tok) |
| 1156 | { |
| 1157 | if (!tok) |
| 1158 | return false; |
| 1159 | if (tok->varId() != 0U) |
| 1160 | return true; |
| 1161 | if (tok->str() == "?") { |
| 1162 | // this is a VLA index if both expressions around the ":" is VLA index |
| 1163 | return tok->astOperand2() && |
| 1164 | tok->astOperand2()->str() == ":" && |
| 1165 | isVLAIndex(tok->astOperand2()->astOperand1()) && |
| 1166 | isVLAIndex(tok->astOperand2()->astOperand2()); |
| 1167 | } |
| 1168 | return isVLAIndex(tok->astOperand1()) || isVLAIndex(tok->astOperand2()); |
| 1169 | } |
| 1170 | |
| 1171 | void CheckBufferOverrunImpl::negativeArraySize() |
| 1172 | { |
no test coverage detected