diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2018-03-28 11:56:35 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2018-03-28 11:56:35 -0400 |
commit | 7faeef296d8b0041ae340c3febf7eb0a78e60b0f (patch) | |
tree | 2527c849fc6c843752abac8229178b941716e88c /builtins.c | |
parent | 2f3ffd11097470095d8e5d7c989ce201d9d6d011 (diff) |
allow solve to error safely
Diffstat (limited to 'builtins.c')
-rw-r--r-- | builtins.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -133,8 +133,10 @@ int bn_solve(instance *it) { variable *s = igetarg(it, 0); variable **ops = iparse(it, (const char *)s->value.p); - if (ops == 0) - return -1; + if (ops == 0) { + ipush(it, (uint32_t)make_varf(0, 0.0f)); + return 0; + } variable *a = isolve(it, ops, 0); free(ops); |