Conversation
cs01
added a commit
that referenced
this pull request
Apr 19, 2026
…verything to double) closes dapweb NOTES #18 (blocker) and #19. root cause: both function-generator.ts and calls.ts had 'if (funcIsAsync) {...} else if (hasParamTypes) {...}' — the async branch set returnType to %Promise* and exclusively skipped the param-type resolution. Async funcs fell through to the fallback loop that pushes 'double' for every param. symptoms: - (#18) async function with mixed string+number+array params received every arg as double in the caller. string arg ended up passed as i64 to strlen → IR type mismatch or segfault. - (#19) module-level 'dispatch();' on an async fn emitted spurious double args because the caller built paramTypes from the fallback rather than func.paramTypes. fix: restructure so async sets returnType first, then FALLS THROUGH to the param-type resolution block. Guard the returnType write inside that block so async's %Promise* isn't overwritten. verified: - async function send(id: string, seq: number, body: string): Promise<string> callable with all three arg types, returns the concatenated string - async function dispatch(): Promise<void> callable at module level without extra args
This was referenced Apr 19, 2026
cs01
added a commit
that referenced
this pull request
Apr 19, 2026
…verything to double) (#566) closes dapweb NOTES #18 (blocker) and #19. root cause: both function-generator.ts and calls.ts had 'if (funcIsAsync) {...} else if (hasParamTypes) {...}' — the async branch set returnType to %Promise* and exclusively skipped the param-type resolution. Async funcs fell through to the fallback loop that pushes 'double' for every param. symptoms: - (#18) async function with mixed string+number+array params received every arg as double in the caller. string arg ended up passed as i64 to strlen → IR type mismatch or segfault. - (#19) module-level 'dispatch();' on an async fn emitted spurious double args because the caller built paramTypes from the fallback rather than func.paramTypes. fix: restructure so async sets returnType first, then FALLS THROUGH to the param-type resolution block. Guard the returnType write inside that block so async's %Promise* isn't overwritten. verified: - async function send(id: string, seq: number, body: string): Promise<string> callable with all three arg types, returns the concatenated string - async function dispatch(): Promise<void> callable at module level without extra args Co-authored-by: cs01 <cs01@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.