Skip to content

Loops compile into a Function without DispatchTable #1294

@rihafilip

Description

@rihafilip

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions