lookupswitch_t*lookupswitch_dup(lookupswitch_t*l)
{
lookupswitch_t*n = malloc(sizeof(lookupswitch_t));
- fprintf(stderr, "lookupswitch dupping not supported yet\n");
+ fprintf(stderr, "Error: lookupswitch dupping not supported yet\n");
n->targets = list_clone(l->targets);
return 0;
}
code_t*code_dup(code_t*c)
{
- /* misses branch relocation */
- fprintf(stderr, "dupping not supported yet\n");
- return 0;
if(!c) return 0;
while(c->prev) c = c->prev;
memcpy(n, c, sizeof(code_t));
opcode_t*op = opcode_get(c->opcode);
+ if(c->branch) {
+ fprintf(stderr, "Error: Can't duplicate branching code\n");
+ return 0;
+ }
char*p = op?op->params:"";
int pos=0;
while(*p) {
int len;
};
-code_t*code_dup(code_t*c); //shallow copy
+code_t*code_dup(code_t*c);
code_t*add_opcode(code_t*atag, U8 op);