Bug 247452 - unhelpful error message for TableGrow
Summary: unhelpful error message for TableGrow
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebAssembly (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Degazio
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-11-03 12:35 PDT by David Degazio
Modified: 2022-11-14 03:05 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Degazio 2022-11-03 12:35:04 PDT
rdar://101241285

When typed function references are enabled, the TypeKind of the Funcref and Externref types becomes RefNull. This causes examples such as

    (module
      (type (;0;) (func (result i32)))
      (func (;0;) (type 0) (result i32)
        (local externref funcref)
        local.get 0
        i32.const 1
        table.grow 0)
      (table (;0;) 500 2000 funcref)
      (table (;1;) 500 2000 externref))

to result in unhelpful error messages like `table.grow expects fill value of type RefNull got RefNull, in function at index 0`. 

Since typed function references are just one instance of the WebAssembly type system becoming more complex in newer proposals, this is probably a good opportunity to improve our error messages in general to log more of the available type information.
Comment 1 David Degazio 2022-11-03 13:17:55 PDT
Pull request: https://github.com/WebKit/WebKit/pull/6098
Comment 2 EWS 2022-11-08 18:32:52 PST
Committed 256472@main (e04540b26853): <https://commits.webkit.org/256472@main>

Reviewed commits have been landed. Closing PR #6098 and removing active labels.
Comment 3 Angelos Oikonomopoulos 2022-11-14 03:05:07 PST
Caused a trivial regression on 32-bit ARM, see https://bugs.webkit.org/show_bug.cgi?id=247886.