30 lines
474 B
C
30 lines
474 B
C
#include <log.h>
|
|
#include <ops.h>
|
|
#include <nanowasm/nw.h>
|
|
#include <wasm_types.h>
|
|
#include <stddef.h>
|
|
#include <stdio.h>
|
|
|
|
static int op(struct nw_interp *const i, FILE *const f)
|
|
{
|
|
varint32 value;
|
|
|
|
if (varint32_read(f, &value))
|
|
{
|
|
LOG("%s: varint32_read failed\n", __func__);
|
|
return -1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
int op_i32_const(struct nw_interp *const i)
|
|
{
|
|
return op(i, i->f);
|
|
}
|
|
|
|
int check_i32_const(FILE *const f)
|
|
{
|
|
return op(NULL, f);
|
|
}
|