summaryrefslogtreecommitdiff
path: root/src/op/br.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/op/br.c')
-rw-r--r--src/op/br.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/op/br.c b/src/op/br.c
new file mode 100644
index 0000000..ef5c34f
--- /dev/null
+++ b/src/op/br.c
@@ -0,0 +1,29 @@
+#include <ops.h>
+#include <interp.h>
+#include <interp_private.h>
+#include <wasm_types.h>
+#include <stddef.h>
+#include <stdio.h>
+
+static int op(FILE *const f, struct interp *const i)
+{
+ varuint32 relative_depth;
+
+ if (varuint32_read(f, &relative_depth))
+ {
+ fprintf(stderr, "%s: varuint32_read failed\n", __func__);
+ return -1;
+ }
+
+ return 0;
+}
+
+int op_br(struct interp *const i)
+{
+ return op(i->cfg.f, i);
+}
+
+int check_br(FILE *const f)
+{
+ return op(f, NULL);
+}