cfloop condition throws error when in tag island

Description

This may be somewhat related to https://luceeserver.atlassian.net/browse/LDEV-4157, but in this specific case, <cfloop condition=""> is the expression that causes Lucee to fail.

<cfscript> ``` <cfset i = 0> <cfloop condition="i <= 3"> <cfoutput>#i#</cfoutput><br /> <cfset i++> </cfloop> ``` </cfscript>

This fails with missing parent Statement of Statement error with following start of a stack trace:

lucee.runtime.exp.TemplateException: missing parent Statement of Statement at lucee.transformer.cfml.evaluator.impl.Loop.evaluate(Loop.java:203) at lucee.transformer.cfml.evaluator.EvaluatorPool.run(EvaluatorPool.java:79) at lucee.transformer.cfml.tag.CFMLTransformer.transform(CFMLTransformer.java:355) at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.islandStatement(AbstrCFMLScriptTransformer.java:2044)

The same code outside a cfscript tag island works just as expected.

Environment

Lucee 5.4.3.2, Tomcat 8

Activity

Show:

Pothys - MitrahSoft 7 September 2023 at 13:33

I've checked this ticket and confirmed that the issue occurred in lucee versions 5.4.3.6-SNAPSHOT and 6.0.0.536-SNAPSHOT. It only fails within the conditional loop.
Added a testcase for this ticket.
PR : https://github.com/lucee/Lucee/pull/2224

Markus Wollny 7 September 2023 at 10:35

Just as an afterthought: replacing the cfloop with <cfwhile condition="#i <= 3#"> doesn’t produce this error, works just fine in a tag island.

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 7 September 2023 at 10:24
Updated 8 September 2023 at 10:22

Flag notifications