Skip to content

Fix call_ref on empty stack - #2472

Merged
sbc100 merged 1 commit into
WebAssembly:mainfrom
SoniEx2:fix-callref-emptystack
Sep 24, 2024
Merged

sbc100 merged 1 commit into
WebAssembly:mainfrom
SoniEx2:fix-callref-emptystack

Conversation

@SoniEx2

@SoniEx2 SoniEx2 commented Sep 23, 2024 •

Copy link
Copy Markdown
Collaborator

Same issue as #2471 but for call_ref.

We don't believe there's a prior issue for this.

@SoniEx2

SoniEx2 commented Sep 24, 2024

Copy link
Copy Markdown
Collaborator Author

@sbc100

Comment thread src/type-checker.cc
PrintError("%s", message.c_str());
result = Result::Error;
Result result = PeekType(0, &type);
if (!type.IsReferenceWithIndex()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it OK to use type here even if PeekType fails? i.e. should we return early if PeekType fails?

@SoniEx2 SoniEx2 Sep 24, 2024 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this is fine. PeekType will set type to Type::Any, this is the same logic as the fix in #2471 - we want the error message.

@sbc100
sbc100 enabled auto-merge (squash) September 24, 2024 14:52
@SoniEx2

SoniEx2 commented Sep 24, 2024

Copy link
Copy Markdown
Collaborator Author

(you'll have to rebase it)

@SoniEx2

SoniEx2 commented Sep 24, 2024

Copy link
Copy Markdown
Collaborator Author

(actually we'll rebase it)

auto-merge was automatically disabled September 24, 2024 17:29

Head branch was pushed to by a user without write access

@SoniEx2
SoniEx2 force-pushed the fix-callref-emptystack branch from d45640e to b9c687f Compare September 24, 2024 17:29
@SoniEx2

SoniEx2 commented Sep 24, 2024

Copy link
Copy Markdown
Collaborator Author

(you'll have to re-enable auto-merge tho)

@sbc100
sbc100 merged commit 790bc04 into WebAssembly:main Sep 24, 2024
@SoniEx2
SoniEx2 deleted the fix-callref-emptystack branch September 24, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants