Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loops compile into a Function without DispatchTable #1294

Open
rihafilip opened this issue Jun 27, 2024 · 0 comments
Open

Loops compile into a Function without DispatchTable #1294

rihafilip opened this issue Jun 27, 2024 · 0 comments
Assignees
Labels

Comments

@rihafilip
Copy link
Collaborator

When running

for (i in 1:10) {}

or

while(true) {}

in a global environment, a Function is compiled, but it is not in a DispatchTable (the dispatchTable_ field is uninitialized).

The eval function in eval.c calls do_for or do_while respectively.
Then the call order is R_compileAndExecute -> R_compileExpr -> externalCodeCompile, which is a pointer to rirCompile -> rir::Compiler::compileExpression -> rir::Compiler::finalize, where the Function is created.

The created Function is afterwards called with rirEval thru R_compileAndExecute.
The calling is going without any issue and this might not be a bug, but it is a weird behaviour.

@rihafilip rihafilip added the bug label Jun 27, 2024
@rihafilip rihafilip changed the title Loops produce a Function without DispatchTable Loops compile into a Function without DispatchTable Jun 27, 2024
@skrynski skrynski self-assigned this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants