summaryrefslogtreecommitdiff
path: root/src/op/get_local.c
blob: f1de025dd3a661b301c28fca1df043af7f1a08c9 (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
#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 local_index;

    if (varuint32_read(f, &local_index))
    {
        fprintf(stderr, "%s: varuint32_read failed\n", __func__);
        return 1;
    }

    return 0;
}

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

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