Skip to content

Commit

Permalink
Make matrix derefs report error locations correctly
Browse files Browse the repository at this point in the history
Example of old behaviour:

gap> f := function()
>  S := [];
>  return S[0];
> end;
gap> f();
Error, no 1st choice method found for `[]' on 2 arguments called from
<compiled or corrupted statement>

Now correctly identifies 'S[0]' as the incorrect code.
  • Loading branch information
ChrisJefferson committed Mar 17, 2015
1 parent 8d94526 commit 70ee840
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vars.c
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,8 @@ Obj EvalElmList (
/* evaluate and check the position */
pos = EVAL_EXPR( ADDR_EXPR(expr)[1] );

SET_BRK_CALL_TO(expr); /* Note possible call for FuncWhere */

if (IS_INTOBJ(pos) && (p = INT_INTOBJ( pos )) > 0)
{

Expand Down

0 comments on commit 70ee840

Please sign in to comment.