[DGD] error recovery with atomic functions
bart at wotf.org
bart at wotf.org
Thu Jun 25 14:57:20 CEST 2015
On Thu, 25 Jun 2015 10:47:56 +0200, Felix A. Croes wrote
> bart at wotf.org wrote:
>
> >[...]
> > On another note, I noticed you made a change to no longer call operator
> > functions in builtin object types. Seems I did have a use for that, I like
> > ob<-"/builtin/function" over object_name(ob) == "/builtin/function#-1", but
> > this no longer works. Oh well, guess I'll deal :-)
>
> That is a bug, actually. When I added the new INSTANCEOF
> instruction, I failed to copy this functionality from the old kfun.
> Pull requests which address this issue will be carefully considered.
> :)
Not a pull request, but a stab at this anyway. Quick test suggests this works,
but it has been a while since I last meddled with such things :-)
Bart.
diff --git a/src/interpret.c b/src/interpret.c
index 18f596a..762b81c 100644
--- a/src/interpret.c
+++ b/src/interpret.c
@@ -2807,7 +2807,12 @@ static void i_interpret1(frame *f, char *pc)
break;
case T_LWOBJECT:
- instance = i_instanceof(f, f->sp->u.array->elts->oindex, l);
+ if (f->sp->u.array->elts->type != T_OBJECT) {
+ instance =
(strcmp(o_builtin_name(f->sp->u.array->elts->u.number),
+ i_classname(f, l)) == 0);
+ } else {
+ instance = i_instanceof(f, f->sp->u.array->elts->oindex, l);
+ }
arr_del(f->sp->u.array);
break;
>
> Regards,
> Felix Croes
> ____________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
--
http://www.flickr.com/photos/mrobjective/
http://www.om-d.org/
More information about the DGD
mailing list