diff options
author | Andrés <andmarti@gmail.com> | 2021-03-23 09:12:11 -0300 |
---|---|---|
committer | Andrés <andmarti@gmail.com> | 2021-03-23 09:12:11 -0300 |
commit | 65f7453324bf393ebfa335a10c115b90761121ac (patch) | |
tree | 70311f7762e0ae541ee3bb01f834e40b0d00a1d6 /src/interp.c | |
parent | eb71c73868520db7fcd707698cbbe2a23d773c90 (diff) |
work on issue #287
Diffstat (limited to 'src/interp.c')
-rw-r--r-- | src/interp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/interp.c b/src/interp.c index 542ddd7..89fa63f 100644 --- a/src/interp.c +++ b/src/interp.c @@ -1106,7 +1106,9 @@ double eval(register struct ent * ent, register struct enode * e) { // here we store the dependences in a graph if (ent && vp) { - if (GraphIsReachable(getVertex(graph, lookat(ent->row, ent->col), 0), getVertex(graph, lookat(vp->row, vp->col), 0), 1)) { + vertexT * v_ent = getVertex(graph, lookat(ent->row, ent->col), 0); + vertexT * v_vp = getVertex(graph, lookat(vp->row, vp->col), 0); + if (v_ent != NULL && v_vp != NULL && GraphIsReachable(v_ent, v_vp, 1)) { sc_debug("Circular reference in eval (cell %s%d)", coltoa(vp->col), vp->row); e->op = ERR_; e->e.o.left = NULL; |