Miscompilation of `makeFunc()()`
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Start by locating the compiler code that emits PCode for function calls and constructor expressions; the issue gives examples for makeFunc()() and new (makeClass())(). Compile those examples and compare the output with the expected sequences in the issue. Done means both cases emit the shown Push undefined before CallMethod or NewMethod, followed by Pop.
Written by the indexing model from the issue text.
Description
This snippet:
makeFunc()();
is compiled as:
Push 0, 0, "makeFunc"
CallFunction
CallFunction // <-- wrong
Pop
which isn't correct; CallFunction expects the name of the function to call, not the function itself, so the PCode should instead be:
Push 0, 0, "makeFunc"
CallFunction
Push undefined // or equivalently, Push ""
CallMethod
Pop
EDIT: A similar issue exists for new (makeClass())()
// Rascal PCode
Push 0, 0, "makeClass"
CallFunction
NewMethod // <-- wrong
// also, missing Pop?
// Expected PCode
Push 0, 0, "makeClass"
CallFunction
Push undefined // or equivalently, Push ""
NewMethod
Pop
- Dominant language
- Rust
- Stars
- 22
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Dinnerbone/Rascal
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Dinnerbone/Rascal#91 · 2 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Dinnerbone/Rascal#88 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Dinnerbone/Rascal#87 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Dinnerbone/Rascal#76 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Dinnerbone/Rascal#1 ·
All issues in Dinnerbone/Rascal
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug i18n priority: medium ui
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
storytold/craft-anything#983 · 1 comment ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pbakaus/impeccable#1328 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
higress-group/HiRoute#405 ·
Maintainers usually reply within 1 day
-
rust_analyzer flycheck: no CLI way to enable clippy from `check.overrideCommand`Possibly taken @TrapsterDK claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
bazelbuild/rules_rust#4392 ·
Maintainers usually reply within 2 days