Status/Resolution/Reason: To Fix//Investigate
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 11/01/2015
Components: Language
Versions: 2016,11.0
Failure Type:
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Major / Some users will encounter
Locale/System: English / Win XP All
Vote Count: 2
implicit struct/array breaks <cfelseif> (no issue in script; issue exists only in tag)
The simplest index.cfm example is: (Throws "Variable ___IMPLICITARRYSTRUCTVAR0 is undefined.")
-----------
<cfif false>
<cfelseif isStruct({foo="bar"})>
</cfif>
-----------
This simplest Application.cfc example is: (Throws "Could not process Application.cfc successfully for template C:/path/to/index.cfm.")
-----------
<cfcomponent>
<cfset THIS.name = "ticket_ImplicitStructArrayBreaksCFElseif">
<cffunction name="onRequestStart">
<cfif false>
<cfelseif isStruct({foo="bar"})>
</cfif>
</cffunction>
</cfcomponent>
-----------
However, here are some more realistic repro cases:
1) Does not display "foobar" (bug) and logs "Accessing value from uninitialized register" to coldfusion-out.log:
--------------------------------------------
index.cfm example
----------------------
<cffunction name="f"><cfargument name="a"><cfreturn true></cffunction>
<cffunction name="c">
<cfif false>
<cfelseif f(a={foo="bar"})>
foobar
</cfif>
</cffunction>
<cfset c()>
index.cfm example
----------------------
<cffunction name="f"><cfargument name="a"><cfreturn true></cffunction>
<cffunction name="c">
<cfif false>
<cfelseif f(a=["foo"])>
foobar
</cfif>
</cffunction>
<cfset c()>
--------------------------------------------
2) Throws "Variable ___IMPLICITARRYSTRUCTVAR0 is undefined.":
--------------------------------------------
index.cfm example
----------------------
<cffunction name="f"><cfargument name="a"><cfreturn true></cffunction>
<cfif false>
<cfelseif f(a={foo="bar"})>
foobar
</cfif>
index.cfm example
----------------------
<cffunction name="f"><cfargument name="a"><cfreturn true></cffunction>
<cfif false>
<cfelseif f(a=["foo"])>
foobar
</cfif>
Application.cfc example
----------------------
<cfcomponent>
<cfset THIS.name = "ticket_ImplicitStructArrayBreaksCFElseif">
<!---<cffunction name="onRequestStart">--->
<cfif false>
foo
<cfelseif f(a={foo="bar"})>
bar
</cfif>
<!---</cffunction>--->
<cffunction name="f"><cfargument name="a"><cfreturn true></cffunction>
</cfcomponent>
Application.cfc example
----------------------
<cfcomponent>
<cfset THIS.name = "ticket_ImplicitStructArrayBreaksCFElseif">
<!---<cffunction name="onRequestStart">--->
<cfif false>
foo
<cfelseif f(a=["foo"])>
bar
</cfif>
<!---</cffunction>--->
<cffunction name="f"><cfargument name="a"><cfreturn true></cffunction>
</cfcomponent>
--------------------------------------------
3) Throws "Could not process Application.cfc successfully for template C:/path/to/index.cfm.":
--------------------------------------------
Application.cfc example
----------------------
<cfcomponent>
<cfset THIS.name = "ticket_ImplicitStructArrayBreaksCFElseif">
<cffunction name="onRequestStart">
<cfif false>
foo
<cfelseif f(a={foo="bar"})>
bar
</cfif>
</cffunction>
<cffunction name="f"><cfargument name="a"><cfreturn true></cffunction>
</cfcomponent>
Application.cfc example
----------------------
<cfcomponent>
<cfset THIS.name = "ticket_ImplicitStructArrayBreaksCFElseif">
<cffunction name="onRequestStart">
<cfif false>
foo
<cfelseif f(a=["foo"])>
bar
</cfif>
</cffunction>
<cffunction name="f"><cfargument name="a"><cfreturn true></cffunction>
</cfcomponent>
--------------------------------------------
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4082131
Reason: BugVerified
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email:
External Test Config: Verified in CF11 Update 5 (build 11,0,05,293506) and build (11,0,0,296013)
Attachments:
Comments: