Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions HeishaMon/src/rules/rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,12 @@ static void bc_assign_slots(struct rules_t *obj) {
(gettype(obj->bc.buffer[a]) == OP_PUSH && (d < 0 || d >= min))) {
continue;
}

if(gettype(obj->bc.buffer[a]) == OP_CALL && getval(x->a) == 0) {
continue;
}
if(gettype(obj->bc.buffer[a]) == OP_SETVAL) {
continue;
}

int32_t e = bc_before(a);
struct vm_top_t *z = NULL;
Expand Down Expand Up @@ -3327,7 +3332,11 @@ static int16_t rule_create(char **text, struct rules_t *obj) {

switch(type) {
case TSEMICOLON: {
bc_parent(obj, OP_CLEAR, 0, 0, 0);
uint16_t a = bc_parent(obj, OP_CLEAR, 0, 0, 0);
{
struct vm_top_t *node = (struct vm_top_t *)&obj->bc.buffer[bc_before(a)];
setval(node->a, 0);
}
pos++;

if(lexer_peek(text, pos, &type, &start, &len) <= 0) {
Expand Down Expand Up @@ -4941,7 +4950,7 @@ int8_t rule_run(struct rules_t *obj, uint8_t validate) {
uint16_t c = (int8_t)getval(node->c);

#if defined(DEBUG) || defined(COVERALLS)
if((int8_t)getval(node->a) >= 0) {
if((int8_t)getval(node->a) > 0) {
logprintf_P(F("FATAL: Internal error in %s #%d pos (%d)"), __FUNCTION__, __LINE__, pos/4);
return -1;
}
Expand All @@ -4966,7 +4975,7 @@ int8_t rule_run(struct rules_t *obj, uint8_t validate) {
return -1;
/* LCOV_EXCL_STOP*/
}
if(rules_gettop() == 1) {
if(rules_gettop() == 1 && a != 4) {
switch(rules_type(-1)) {
case VNULL: {
struct vm_vnull_t *upd = (struct vm_vnull_t *)&obj->heap->buffer[a];
Expand Down
Loading