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