diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-25 15:39:56 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-25 15:39:56 +0000 |
commit | ee7a17a6792e178541d0504fb6ceaae6d625e463 (patch) | |
tree | 09af4907d5a255730ecd36e3373c0f4d223c68c9 /vm.c | |
parent | 50ddd3fd7de672a2fa2df67adb27401cc38ce38c (diff) | |
download | rsyslog-ee7a17a6792e178541d0504fb6ceaae6d625e463.tar.gz rsyslog-ee7a17a6792e178541d0504fb6ceaae6d625e463.tar.xz rsyslog-ee7a17a6792e178541d0504fb6ceaae6d625e463.zip |
fixed segfault when pure string values were tried to be added
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -82,7 +82,7 @@ BOOLOP(AND, &&) /* code generator for numerical operations */ -#define BOOLOP(name, OPERATION) \ +#define NUMOP(name, OPERATION) \ BEGINop(name) /* remember to set the instruction also in the ENDop macro! */ \ var_t *operand1; \ var_t *operand2; \ @@ -90,15 +90,14 @@ CODESTARTop(name) \ vmstk.PopNumber(pThis->pStk, &operand1); \ vmstk.PopNumber(pThis->pStk, &operand2); \ operand1->val.num = operand1->val.num OPERATION operand2->val.num; \ -RUNLOG_VAR("%lld", operand1->val.num); \ vmstk.Push(pThis->pStk, operand1); /* result */ \ var.Destruct(&operand2); /* no longer needed */ \ ENDop(name) -BOOLOP(PLUS, +) -BOOLOP(MINUS, -) -BOOLOP(TIMES, *) -BOOLOP(DIV, /) -BOOLOP(MOD, %) +NUMOP(PLUS, +) +NUMOP(MINUS, -) +NUMOP(TIMES, *) +NUMOP(DIV, /) +NUMOP(MOD, %) #undef BOOLOP |