61
61
/* destructor for the vmop object */
62
62
BEGINobjDestruct(vmop) /* be sure to specify the object type also in END and CODESTART macros! */
63
63
CODESTARTobjDestruct(vmop)
64
if( pThis->opcode == opcode_PUSHSYSVAR
65
|| pThis->opcode == opcode_PUSHMSGVAR
66
|| pThis->opcode == opcode_PUSHCONSTANT) {
67
if(pThis->operand.pVar != NULL)
68
var.Destruct(&pThis->operand.pVar);
64
if(pThis->operand.pVar != NULL)
65
var.Destruct(&pThis->operand.pVar);
70
66
ENDobjDestruct(vmop)
73
69
/* DebugPrint support for the vmop object */
74
70
BEGINobjDebugPrint(vmop) /* be sure to specify the object type also in END and CODESTART macros! */
75
71
uchar *pOpcodeName;
76
73
CODESTARTobjDebugPrint(vmop)
77
74
vmopOpcode2Str(pThis, &pOpcodeName);
78
dbgoprint((obj_t*) pThis, "opcode: %d\t(%s), next %p, var in next line\n", (int) pThis->opcode, pOpcodeName,
80
if(pThis->operand.pVar != NULL)
81
var.DebugPrint(pThis->operand.pVar);
75
CHKiRet(rsCStrConstruct(&pStrVar));
76
CHKiRet(rsCStrFinish(&pStrVar));
77
if(pThis->operand.pVar != NULL) {
78
CHKiRet(var.Obj2Str(pThis->operand.pVar, pStrVar));
80
dbgoprint((obj_t*) pThis, "%.12s\t%s\n", pOpcodeName, rsCStrGetSzStrNoNULL(pStrVar));
81
rsCStrDestruct(&pStrVar);
82
83
ENDobjDebugPrint(vmop)
158
159
*ppName = (uchar*) "and";
160
161
case opcode_PLUS:
161
*ppName = (uchar*) "+";
162
*ppName = (uchar*) "add";
163
164
case opcode_MINUS:
164
*ppName = (uchar*) "-";
165
*ppName = (uchar*) "sub";
166
167
case opcode_TIMES:
167
*ppName = (uchar*) "*";
168
*ppName = (uchar*) "mul";
170
*ppName = (uchar*) "/";
171
*ppName = (uchar*) "div";
173
*ppName = (uchar*) "%";
174
*ppName = (uchar*) "mod";
176
177
*ppName = (uchar*) "not";
178
179
case opcode_CMP_EQ:
179
*ppName = (uchar*) "==";
180
*ppName = (uchar*) "cmp_==";
181
182
case opcode_CMP_NEQ:
182
*ppName = (uchar*) "!=";
183
*ppName = (uchar*) "cmp_!=";
184
185
case opcode_CMP_LT:
185
*ppName = (uchar*) "<";
186
*ppName = (uchar*) "cmp_<";
187
188
case opcode_CMP_GT:
188
*ppName = (uchar*) ">";
189
*ppName = (uchar*) "cmp_>";
190
191
case opcode_CMP_LTEQ:
191
*ppName = (uchar*) "<=";
192
*ppName = (uchar*) "cmp_<=";
193
194
case opcode_CMP_CONTAINS:
194
195
*ppName = (uchar*) "contains";
197
198
*ppName = (uchar*) "startswith";
199
200
case opcode_CMP_GTEQ:
200
*ppName = (uchar*) ">=";
201
*ppName = (uchar*) "cmp_>=";
202
203
case opcode_PUSHSYSVAR:
203
*ppName = (uchar*) "PUSHSYSVAR";
204
*ppName = (uchar*) "push_sysvar";
205
206
case opcode_PUSHMSGVAR:
206
*ppName = (uchar*) "PUSHMSGVAR";
207
*ppName = (uchar*) "push_msgvar";
208
209
case opcode_PUSHCONSTANT:
209
*ppName = (uchar*) "PUSHCONSTANT";
210
*ppName = (uchar*) "push_const";
212
*ppName = (uchar*) "POP";
213
*ppName = (uchar*) "pop";
214
215
case opcode_UNARY_MINUS:
215
*ppName = (uchar*) "UNARY_MINUS";
216
*ppName = (uchar*) "unary_minus";
217
218
case opcode_STRADD:
218
*ppName = (uchar*) "STRADD";
219
*ppName = (uchar*) "strconcat";
221
case opcode_FUNC_CALL:
222
*ppName = (uchar*) "func_call";
221
*ppName = (uchar*) "INVALID opcode";
225
*ppName = (uchar*) "!invalid_opcode!";