Title:
Variable half-disappears from struct after added, but only if first calling a function with argumentcollection=arguments
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Paul Karlin / Paul Karlin (Paul Karlin)
Created: 10/04/2012
Components: Language
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: Final / 284806
Priority/Frequency: Major / All users will encounter
Locale/System: English / Windows 7 SP1 64-bit
Vote Count: 8
Problem Description:
We have a large base of code that used to work fine in CF8.0.1 and we are trying to upgrade to CF10. Here is a simplified example that will work in a stand-alone CFM file (also attached as debug.cfm):
<cffunction name="innerTest" access="public" output="true" returntype="void">
<cfset var ls = {} />
<cfset ls.argsGood = StructCopy(arguments) />
<cfset dummyTest(argumentcollection=arguments) />
<cfset ls.argsBad = StructCopy(arguments) />
<cfset ls.argsGood.d = arguments.c />
<cfset ls.argsBad.d = arguments.c />
<cfoutput>
inner args: ls.argsGood.d = #ls.argsGood.d#
<cfdump var="#ls.argsGood#"/>
ls.argsBad.d = #ls.argsBad.d#
<cfdump var="#ls.argsBad#"/>
</cfoutput>
</cffunction>
<cffunction name="dummyTest" access="public" output="false" returntype="void">
</cffunction>
<cfset innerTest(a="1",b="2",c="3")/>
Steps to Reproduce:
Place debug.cfm anywhere under ColdFusion's web root and retrieve it from your browser.
Actual Result (in CF10):
inner args: ls.argsGood.d = 3
struct
D 3
a 1
b 2
c 3
ls.argsBad.d = 3
struct
a 1
b 2
c 3
Expected Result (actual result in CF8):
inner args: ls.argsGood.d = 3
struct
D 3
a 1
b 2
c 3
ls.argsBad.d = 3
struct
D 3
a 1
b 2
c 3
Any Workarounds:
Rewrite hundreds of lines of our working CF8 code to avoid calling functions with argumentcollection=arguments before using StructCopy.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3341284
Keywords:
FixTested
External Customer Info:
External Company:
External Customer Name: Paul Karlin
External Customer Email:
External Test Config: My Hardware and Environment details:
Windows 7 Enterprise or 2008R2 Web/Standard Edition, 64-bit CF10, 64-bit JDK1.6.0_31, connected via IIS
Attachments:
- October 05, 2012 00:00:00: 1_debug.cfm
Comments: