summaryrefslogtreecommitdiff
path: root/src/apply-names.c
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2017-01-23 12:00:24 -0800
committerGitHub <noreply@github.com>2017-01-23 12:00:24 -0800
commitce3d0e454cb27a2417e8f3e1273be1b904dce542 (patch)
treefbc626eb69404eeb7818e9bd48c5eaaa787f778f /src/apply-names.c
parent5a658b3f2b90cce2bb3d81994828d29b74e41958 (diff)
downloadwabt-ce3d0e454cb27a2417e8f3e1273be1b904dce542.tar.gz
wabt-ce3d0e454cb27a2417e8f3e1273be1b904dce542.tar.bz2
wabt-ce3d0e454cb27a2417e8f3e1273be1b904dce542.zip
Don't apply names in name section to globals (#287)
The name section currently only provides names for functions and locals. This fixes issue #286.
Diffstat (limited to 'src/apply-names.c')
-rw-r--r--src/apply-names.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/apply-names.c b/src/apply-names.c
index 23ba7c1a..96e2c2b0 100644
--- a/src/apply-names.c
+++ b/src/apply-names.c
@@ -303,7 +303,9 @@ static WasmResult visit_func(Context* ctx,
static WasmResult visit_export(Context* ctx,
uint32_t export_index,
WasmExport* export) {
- use_name_for_func_var(ctx->allocator, ctx->module, &export->var);
+ if (export->kind == WASM_EXTERNAL_KIND_FUNC) {
+ use_name_for_func_var(ctx->allocator, ctx->module, &export->var);
+ }
return WASM_OK;
}