Changeset 183 for trunk/thune/eval.c
- Timestamp:
- 06/11/06 05:58:53 (3 years ago)
- Files:
-
- 1 modified
-
trunk/thune/eval.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thune/eval.c
r182 r183 488 488 489 489 490 static void _throwUnbound( UThread* ur_thread, UCell* wcell ) 490 #define _throwUnset(th,cell) _throwUnsetF(th,cell,"unset") 491 #define _throwUnbound(th,cell) _throwUnsetF(th,cell,"unbound") 492 493 static void _throwUnsetF( UThread* ur_thread, UCell* wcell, 494 const char* umsg ) 491 495 { 492 496 UString* str; … … 496 500 ur_termCStr( str ); 497 501 ur_throwErr( ur_thread, UR_EX_SCRIPT, 498 "word '%s is unbound", str->ptr.c);502 "word '%s is %s", str->ptr.c, umsg ); 499 503 } 500 504 … … 795 799 //case OP_END: 796 800 // goto finish; 801 802 default: 803 _throwUnsetF( ur_thread, pc, "an invalid opcode" ); 804 goto op_throw_cc; 797 805 } 798 806 break; … … 803 811 { 804 812 _throwUnbound( ur_thread, pc ); 805 UR_CALL_OP = 0; 806 goto op_throw; 813 goto op_throw_cc; 807 814 } 808 815 809 816 ur_wordCell( pc, blk, val ); 810 817 ++pc; 818 811 819 do_func: 812 820 if( ur_is(val, UT_FUNCTION) ) … … 922 930 goto call_return; 923 931 } 932 else if( ur_is(val, UT_UNSET) ) 933 { 934 _throwUnset( ur_thread, pc - 1 ); 935 goto op_throw_cc; 936 } 924 937 else 925 938 { … … 939 952 assert( pc->word.index > -1 ); 940 953 ur_wordCell( pc, blk, val ); 954 if( ur_is(val, UT_UNSET) ) 955 { 956 _throwUnset( ur_thread, pc ); 957 goto op_throw_cc; 958 } 941 959 ++pc; 942 960 UR_S_PUSH( *val ); … … 946 964 if( ! ur_resolveSelector( ur_thread, pc++, UR_S_GROW ) ) 947 965 { 948 UR_CALL_OP = 0; 949 goto op_throw; 966 goto op_throw_cc; 950 967 } 951 968 break; … … 1050 1067 } 1051 1068 1069 op_throw_cc: 1070 1071 UR_CALL_OP = 0; 1072 1052 1073 op_throw: 1053 1074 … … 1771 1792 blk = ur_blockPtr( ctx->ctx.valBlk ); 1772 1793 ur_copyCell(ctx, blk->ptr.cells[ wrdN ]); 1794 /* 1795 if( ur_is(ctx, UT_UNSET) ) 1796 _throwUnset( ur_thread, ctx ); 1797 */ 1773 1798 return; 1774 1799 }
