From e577dca32ed2be18e2739313f791cd0103c7de49 Mon Sep 17 00:00:00 2001 From: dzaima Date: Mon, 30 Aug 2021 22:27:04 +0300 Subject: [PATCH] =?UTF-8?q?make=20!=F0=9D=95=A9=20throw=20=F0=9D=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/sysfn.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/builtins/sysfn.c b/src/builtins/sysfn.c index bf3bfd1b..8e860bee 100644 --- a/src/builtins/sysfn.c +++ b/src/builtins/sysfn.c @@ -147,23 +147,19 @@ B grOrd_c2(B t, B w, B x) { // assumes valid arguments } B asrt_c1(B t, B x) { - if (isI32(x) && 1==(i32)x.u) return x; - if (isF64(x) && 1==x.f) return x; - dec(x); - thrM("Assertion error"); + if (isF64(x) && o2fu(x)==1) return x; + if (isF64(x)) thrM("Assertion error"); + thr(x); } B asrt_c2(B t, B w, B x) { - if (isI32(x) && 1==(u32)x.u) { dec(w); return x; } - if (isF64(x) && 1==x.f) { dec(w); return x; } + if (isF64(x) && o2fu(x)==1) { dec(w); return x; } dec(x); thr(w); } B casrt_c1(B t, B x) { - if (isI32(x) && 1==(i32)x.u) return x; - if (isF64(x) && 1==x.f) return x; + if (isF64(x) && o2fu(x)==1) return x; unwindCompiler(); - dec(x); - thrM("Compilation error"); + thr(x); } B casrt_c2(B t, B w, B x) { if (isI32(x) && 1==(u32)x.u) { dec(w); return x; }