Repository navigation
fix: exact return counts and scope-aware math-spec eligibility - #22
Merged
Merged
Conversation
Tail returns use prefix plus callee count, vararg tails stay unknown, and a local or nested callee is not specialized or called as its file-level homonym. Co-authored-by: Cursor <cursoragent@cursor.com>
var_to_def_map_.find(var_ptr) matches chunk-scoped file-level local functions as well, falsely treating them as local value bindings. This bypassed argument count validation and direct local function call compilation.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22 +/- ##
==========================================
- Coverage 87.95% 87.86% -0.09%
==========================================
Files 122 122
Lines 24482 24657 +175
==========================================
+ Hits 21533 21666 +133
- Misses 2949 2991 +42 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
return .../return x, ...记为未知。只有所有路径返回数一致时才保留精确值,否则调用点按多返回值展开。return f()按词法作用域解析被调。形参、局部变量,以及与文件级函数同名的嵌套local function,不再套用文件级函数的返回数或数学特化。没有同名文件级函数、且嵌套函数精确返回 1 个值时,外层仍然可以特化。FlMakeMulti放进int64_t特化函数的非法 C。C 代码生成和解释器都会调用局部绑定,而不是同名的文件级函数。Test plan
infer.test_jitbug_vararg_passthrough:纯return ...在调用点展开infer.test_jitbug_return_exact:return a, f()精确计数,路径不一致时不特化infer.test_jitbug_return_scope:同名嵌套函数 / 形参不特化,无同名嵌套函数仍可特化,运行结果为 62test_spec_fib、test_spec_nested_call、test_count_loop等)通过Made with Cursor