summaryrefslogtreecommitdiffstats
path: root/vmstk.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-25 10:28:23 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-25 10:28:23 +0000
commita24cee11b718603fbc681e4a7a23f50c8d785ad7 (patch)
treea192855ad3f853e1b75fcdeab6c9d56e9e7299da /vmstk.c
parent838ab14a17a60116d6fd51ebcf12416d736af546 (diff)
downloadrsyslog-a24cee11b718603fbc681e4a7a23f50c8d785ad7.tar.gz
rsyslog-a24cee11b718603fbc681e4a7a23f50c8d785ad7.tar.xz
rsyslog-a24cee11b718603fbc681e4a7a23f50c8d785ad7.zip
- added some temporary testing aids to conf.c, so that we can debug
expression support as it is implemented - fixed a couple of bugs in expression system - added more operations to virtual machine - now works well with constants
Diffstat (limited to 'vmstk.c')
-rw-r--r--vmstk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/vmstk.c b/vmstk.c
index 6f8d36f6..a739f395 100644
--- a/vmstk.c
+++ b/vmstk.c
@@ -89,6 +89,8 @@ finalize_it:
/* pop a value from the stack
+ * IMPORTANT: the stack pointer always points to the NEXT FREE entry. So in
+ * order to pop, we must access the element one below the stack pointer.
* The user is responsible for destructing the ppVar returned.
*/
static rsRetVal
@@ -97,12 +99,12 @@ pop(vmstk_t *pThis, var_t **ppVar)
DEFiRet;
ISOBJ_TYPE_assert(pThis, vmstk);
- assert(ppVar != NULL);
+ ASSERT(ppVar != NULL);
if(pThis->iStkPtr == 0)
ABORT_FINALIZE(RS_RET_STACK_EMPTY);
- *ppVar = pThis->vStk[pThis->iStkPtr--];
+ *ppVar = pThis->vStk[--pThis->iStkPtr];
finalize_it:
RETiRet;