mirror of
https://github.com/sfall-team/sslc.git
synced 2026-07-27 16:52:49 -07:00
Fixed crash for parser.dll
This commit is contained in:
@@ -1139,12 +1139,14 @@ static void term_prime(Procedure *p, NodeList *nodes) {
|
||||
Node *node;
|
||||
// term(p, nodes);
|
||||
factor(p, nodes);
|
||||
node = &nodes->nodes[nodes->numNodes - 1];
|
||||
if ((i == '/' || i == '%' || i == T_DIV2) && node->token == T_CONSTANT && node->value.type != V_STRING && node->value.intData == 0) {
|
||||
parseSemanticError("Division by zero!");
|
||||
if (nodes->numNodes > 0) { // fix crash for DLL
|
||||
node = &nodes->nodes[nodes->numNodes - 1];
|
||||
if ((i == '/' || i == '%' || i == T_DIV2) && node->token == T_CONSTANT && node->value.type != V_STRING && node->value.intData == 0) {
|
||||
parseSemanticError("Division by zero!");
|
||||
}
|
||||
emitOp(p, nodes, i);
|
||||
term_prime(p, nodes);
|
||||
}
|
||||
emitOp(p, nodes, i);
|
||||
term_prime(p, nodes);
|
||||
}
|
||||
else ungetToken();
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,10 +6,10 @@
|
||||
|
||||
#define VERSION_MAJOR 4
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_BUILD 3
|
||||
#define VERSION_BUILD 4
|
||||
#define VERSION_REV 0
|
||||
|
||||
#define VERSION_STRING "4.2.3"
|
||||
#define VERSION_STRING "4.2.4"
|
||||
|
||||
#ifdef BUILDING_DLL
|
||||
#define FILE_STRING "parser.dll"
|
||||
|
||||
Reference in New Issue
Block a user