tracker issue : CF-4082131

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] Bug for: implicit struct/array breaks <cfelseif>

| View in Tracker

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:

Have asked support for some data !
Comment by Suresh J.
5394 | January 20, 2016 06:44:50 AM GMT
I seem to be encountering this on CF11 Update 10.
Vote by Carl V.
5398 | January 25, 2017 06:19:33 PM GMT
I'm getting the same error with this code: <cfelseif arrayFindNoCase( [ "Assigned", "In Progress", "QA Returned" ], someVariable ) GT 0>. CF11 update 10.
Comment by Carl V.
5395 | January 25, 2017 06:20:41 PM GMT
This issue also exists in CF2016 Update 3.
Comment by Carl V.
5396 | January 25, 2017 06:52:31 PM GMT
Yer *still* having issues with this ___IMPLICITARRYSTRUCTVAR0 stuff? Jesus.
Vote by Adam C.
5399 | February 15, 2017 06:19:26 PM GMT
This also fails: <cfset someValue=""> <cfif invoke("path.to.myCFC", "myMethodThatReturnsBoolean", {someArg=someValue})> Throws exception saying someValue doesn't exist. Will this issue be fixed by this ticket? Or should I file a new ticket for this issue? PLEASE, Please, please, sort out all the IMPLICITARRYSTRUCTVAR issues, for good, in cfscript 2.0. Thanks!, -Aaron
Comment by Aaron N.
5397 | April 16, 2017 09:57:38 PM GMT