fix bad indexing (obs from Jos)

This commit is contained in:
Vitor Santos Costa 2012-12-07 23:43:00 +00:00
parent b98b09e7de
commit f0b44b9b77
7 changed files with 21 additions and 9 deletions

View File

@ -319,9 +319,9 @@
OPCODE(p_func2f_yx ,yxx), OPCODE(p_func2f_yx ,yxx),
OPCODE(p_func2f_yy ,yyx), OPCODE(p_func2f_yy ,yyx),
OPCODE(p_functor ,e), OPCODE(p_functor ,e),
OPCODE(p_execute_tail ,Osbmp),
OPCODE(p_execute2 ,Osbpp), OPCODE(p_execute2 ,Osbpp),
OPCODE(p_execute ,Osbmp), OPCODE(p_execute ,Osbmp),
OPCODE(p_execute_tail ,Osbpp),
#ifdef YAPOR #ifdef YAPOR
OPCODE(getwork_first_time ,e), OPCODE(getwork_first_time ,e),
OPCODE(getwork ,Otapl), OPCODE(getwork ,Otapl),

View File

@ -292,7 +292,7 @@
case _write_void: case _write_void:
cl = NEXTOP(cl,e); cl = NEXTOP(cl,e);
break; break;
case _write_struct: case _write_l_struc:
cl = NEXTOP(cl,fa); cl = NEXTOP(cl,fa);
break; break;
case _write_longint: case _write_longint:
@ -358,6 +358,12 @@
case _unify_l_float_write: case _unify_l_float_write:
cl = NEXTOP(cl,od); cl = NEXTOP(cl,od);
break; break;
case _unify_l_struc:
cl = NEXTOP(cl,ofa);
break;
case _unify_l_struc_write:
cl = NEXTOP(cl,ofa);
break;
case _unify_struct: case _unify_struct:
cl = NEXTOP(cl,ofa); cl = NEXTOP(cl,ofa);
break; break;

View File

@ -327,6 +327,12 @@
case _unify_l_float_write: case _unify_l_float_write:
cl = NEXTOP(cl,od); cl = NEXTOP(cl,od);
break; break;
case _unify_l_struc:
cl = NEXTOP(cl,ofa);
break;
case _unify_l_struc_write:
cl = NEXTOP(cl,ofa);
break;
case _unify_struct: case _unify_struct:
cl = NEXTOP(cl,ofa); cl = NEXTOP(cl,ofa);
break; break;

View File

@ -53,6 +53,7 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS)
break; break;
/* instructions type Osbmp */ /* instructions type Osbmp */
case _p_execute: case _p_execute:
case _p_execute_tail:
OrArgAdjust(pc->u.Osbmp.or_arg); OrArgAdjust(pc->u.Osbmp.or_arg);
pc->u.Osbmp.s = ConstantAdjust(pc->u.Osbmp.s); pc->u.Osbmp.s = ConstantAdjust(pc->u.Osbmp.s);
pc->u.Osbmp.bmap = CellPtoHeapAdjust(pc->u.Osbmp.bmap); pc->u.Osbmp.bmap = CellPtoHeapAdjust(pc->u.Osbmp.bmap);
@ -75,7 +76,6 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS)
case _call_usercpred: case _call_usercpred:
case _fcall: case _fcall:
case _p_execute2: case _p_execute2:
case _p_execute_tail:
OrArgAdjust(pc->u.Osbpp.or_arg); OrArgAdjust(pc->u.Osbpp.or_arg);
pc->u.Osbpp.s = ConstantAdjust(pc->u.Osbpp.s); pc->u.Osbpp.s = ConstantAdjust(pc->u.Osbpp.s);
pc->u.Osbpp.bmap = CellPtoHeapAdjust(pc->u.Osbpp.bmap); pc->u.Osbpp.bmap = CellPtoHeapAdjust(pc->u.Osbpp.bmap);

View File

@ -49,6 +49,7 @@
break; break;
/* instructions type Osbmp */ /* instructions type Osbmp */
case _p_execute: case _p_execute:
case _p_execute_tail:
#ifdef YAPOR #ifdef YAPOR
CHECK(save_OrArg(stream, pc->u.Osbmp.or_arg)); CHECK(save_OrArg(stream, pc->u.Osbmp.or_arg));
#endif #endif
@ -75,7 +76,6 @@
case _call_usercpred: case _call_usercpred:
case _fcall: case _fcall:
case _p_execute2: case _p_execute2:
case _p_execute_tail:
#ifdef YAPOR #ifdef YAPOR
CHECK(save_OrArg(stream, pc->u.Osbpp.or_arg)); CHECK(save_OrArg(stream, pc->u.Osbpp.or_arg));
#endif #endif

View File

@ -32,6 +32,7 @@
break; break;
/* instructions type Osbmp */ /* instructions type Osbmp */
case _p_execute: case _p_execute:
case _p_execute_tail:
pc = NEXTOP(pc,Osbmp); pc = NEXTOP(pc,Osbmp);
break; break;
/* instructions type Osbpa */ /* instructions type Osbpa */
@ -47,8 +48,6 @@
return walk_found_c_pred(pp, startp, endp); return walk_found_c_pred(pp, startp, endp);
case _p_execute2: case _p_execute2:
return found_meta_call(startp, endp); return found_meta_call(startp, endp);
case _p_execute_tail:
return found_meta_call(startp, endp);
case _call: case _call:
case _fcall: case _fcall:
clause_code = TRUE; clause_code = TRUE;

View File

@ -1034,9 +1034,10 @@ opinfo("unify_l_n_atoms_write",[]).
opinfo("write_n_atoms",[body]). opinfo("write_n_atoms",[body]).
opinfo("unify_struct",[]). opinfo("unify_struct",[]).
opinfo("unify_struct_write",[]). opinfo("unify_struct_write",[]).
opinfo("unify_l_struct",[]). opinfo("unify_l_struc",[]).
opinfo("unify_l_struct_write",[]). opinfo("unify_l_struc_write",[]).
opinfo("write_struct",[body]). opinfo("write_struc",[body]).
opinfo("write_l_struc",[body]).
opinfo("unify_float",[]). opinfo("unify_float",[]).
opinfo("unify_float_write",[]). opinfo("unify_float_write",[]).
opinfo("unify_l_float",[]). opinfo("unify_l_float",[]).