================
@@ -199,6 +199,12 @@ TARGET_BUILTIN(__builtin_wasm_ref_is_null_extern, "ii", 
"nct", "reference-types"
 // return type.
 TARGET_BUILTIN(__builtin_wasm_ref_null_func, "i", "nct", "reference-types")
 
+// Check if the runtime type of a function pointer matches its static type. 
Used
+// to avoid "function signature mismatch" traps. Takes a function pointer, uses
+// table.get to look up the pointer in __indirect_function_table and then
+// ref.test to test the type.
+TARGET_BUILTIN(__builtin_wasm_test_function_pointer_signature, "i.", "nct", 
"reference-types")
----------------
tlively wrote:

`ref.test` is only added with the GC proposal, so if we emit it with only 
reference-types enabled, the resulting binary will not validate in wasm-opt. We 
need to introduce a new `gc` feature that puts `"gc"` in the target features 
section, then make this builtin depend on that new feature.

https://github.com/llvm/llvm-project/pull/150201
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to