diff --git a/ast.cpp b/ast.cpp index ca465571..d858c371 100644 --- a/ast.cpp +++ b/ast.cpp @@ -420,6 +420,13 @@ lCheckAllOffSafety(ASTNode *node, void *data) { return false; } + if (llvm::dyn_cast(node) != NULL) { + BinaryExpr* binaryExpr = llvm::dyn_cast(node); + if (binaryExpr->op == BinaryExpr::Mod || binaryExpr->op == BinaryExpr::Div) { + *okPtr = false; + return false; + } + } IndexExpr *ie; if ((ie = llvm::dyn_cast(node)) != NULL && ie->baseExpr != NULL) { const Type *type = ie->baseExpr->GetType();