From da4e17d827c444bbbcceb08d577c528020d4d959 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Fri, 16 Apr 2021 17:55:35 -0700 Subject: LegalizeJSInterface: Remove illegal imports once they are no longer used (#3815) This prevents used imports which also happen to have duplicate names and therefore cannot be provided by wasm (JS is happen to fill these in with polymorphic JS functions). I noticed this when working on emscripten and directly hooking modules together. I was seeing failures, but not in release builds (because wasm-opt would mop these up in release builds). --- test/lld/duplicate_imports.wat.out | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/lld') diff --git a/test/lld/duplicate_imports.wat.out b/test/lld/duplicate_imports.wat.out index 221592373..3160d1dc2 100644 --- a/test/lld/duplicate_imports.wat.out +++ b/test/lld/duplicate_imports.wat.out @@ -1,15 +1,14 @@ (module - (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_f32_f64_=>_f32 (func (param i32 f32 f64) (result f32))) (type $i32_f64_f64_=>_f32 (func (param i32 f64 f64) (result f32))) (type $2 (func)) (type $1 (func (result i32))) (type $0 (func (param i32) (result i32))) + (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $f32_f64_=>_f32 (func (param f32 f64) (result f32))) (type $f64_f64_=>_f32 (func (param f64 f64) (result f32))) (import "env" "puts" (func $puts1 (param i32) (result i32))) - (import "env" "puts" (func $puts2 (param i64) (result i32))) (import "env" "invoke_ffd" (func $invoke_ffd (param i32 f32 f64) (result f32))) (import "env" "invoke_ffd" (func $invoke_ffd2 (param i32 f64 f64) (result f32))) (import "env" "puts" (func $legalimport$puts2 (param i32 i32) (result i32))) -- cgit v1.2.3