From 48ab2cb8e3de88dbd0722337bd4617ad22de1a12 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Fri, 15 May 2026 20:11:51 -0400 Subject: Clear error on get_error --- src/runtime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/runtime.c b/src/runtime.c index 3f17894..33c9db6 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -156,7 +156,9 @@ i64 pit_dump(pit_runtime *rt, char *buf, i64 len, pit_value v, bool readable) { } pit_value pit_get_error(pit_runtime *rt) { - return rt->error; + pit_value ret = rt->error; + rt->error = PIT_NIL; + return ret; } void pit_error(pit_runtime *rt, char *format, ...) { -- cgit v1.2.3