aboutsummaryrefslogtreecommitdiff
path: root/src/op/i32_load.c
blob: e00cc2dca09e5dcecc4c9dd7a0168cc1b2a135c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#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)
{
    varint32 flags, offset;

    if (varint32_read(f, &flags))
    {
        fprintf(stderr, "%s: varint32_read flags failed\n", __func__);
        return 1;
    }
    else if (varint32_read(f, &offset))
    {
        fprintf(stderr, "%s: varint32_read offset failed\n", __func__);
        return 1;
    }

    return 0;
}

int op_i32_load(struct interp *const i)
{
    return op(i->cfg.f, i);
}

int check_i32_load(FILE *const f)
{
    return op(f, NULL);
}