aboutsummaryrefslogtreecommitdiffstats
path: root/builtins.c
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2018-03-28 11:56:35 -0400
committerClyne Sullivan <clyne@bitgloo.com>2018-03-28 11:56:35 -0400
commit7faeef296d8b0041ae340c3febf7eb0a78e60b0f (patch)
tree2527c849fc6c843752abac8229178b941716e88c /builtins.c
parent2f3ffd11097470095d8e5d7c989ce201d9d6d011 (diff)
allow solve to error safely
Diffstat (limited to 'builtins.c')
-rw-r--r--builtins.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtins.c b/builtins.c
index c68b3d9..883dd20 100644
--- a/builtins.c
+++ b/builtins.c
@@ -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);