commit 806b33b6be11620e2d27c5534eb7bdeea97d9c86
parent a5b1d41391e5eab511629b73ee1a648d7910ccbe
Author: William Casarin <jb55@jb55.com>
Date: Sat, 24 Jul 2021 19:34:50 -0700
fix pretty amazing interp_if bug LOL
I'm really dumb
HOW DID PROGRAMS WORK AT ALL?
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/io.c b/src/io.c
@@ -44,7 +44,7 @@ int read_file(const char *filename, unsigned char *buf, int buflen, int *written
FILE *file = NULL;
int ok;
- file = fopen(filename, "rb");
+ file = fopen(filename, "r");
if (file == NULL) {
*written = strlen(filename)+1;
memcpy(buf, filename, *written);
diff --git a/src/wasm.c b/src/wasm.c
@@ -4180,7 +4180,7 @@ static int interp_if(struct wasm_interp *interp)
return interp_error(interp, "label checkpoint");
}
- if (cond.num.i32 == 1) {
+ if (cond.num.i32 != 0) {
return 1;
}