# Bizarre stack overflow

**URL:** <https://forum.kirupa.com/t/bizarre-stack-overflow/332069>\
**Category:** flash\
**Created:** [January 15, 2014, 8:15pm UTC](https://forum.kirupa.com/t/bizarre-stack-overflow/332069 "2014-01-15T20:15:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![e\_v](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/e_v/32/7787_2.png) [@e\_v](https://forum.kirupa.com/u/e_v)\
**Post date:** [January 15, 2014, 8:15pm UTC](https://forum.kirupa.com/t/bizarre-stack-overflow/332069/1 "2014-01-15T20:15:12Z")

</div>

Given the following in the document class:

```auto
private function onAddedToStage(e:Event):void{
    var userInfo:SomeClass = makeUserInfo("John", "Doe");
}
    
private function makeUserInfo(firstName:String, lastName:String, thirdly:Boolean=false):SomeClass{
    var info:SomeClass = new SomeClass();
    return info;
}

```

I get the following error:

```auto
verify TestJustUserInfoInstantiation/makeUserInfo()
                        stack:
                        scope: [global Object$ flash.events::EventDispatcher$ flash.display::DisplayObject$ flash.display::InteractiveObject$ flash.display::DisplayObjectContainer$ flash.display::Sprite$ TestJustUserInfoInstantiation$] ~ 
                         locals: TestJustUserInfoInstantiation String? String? Boolean * 
  0:getlocal0
                        stack: TestJustUserInfoInstantiation
                        scope: [global Object$ flash.events::EventDispatcher$ flash.display::DisplayObject$ flash.display::InteractiveObject$ flash.display::DisplayObjectContainer$ flash.display::Sprite$ TestJustUserInfoInstantiation$] ~ 
                         locals: TestJustUserInfoInstantiation String? String? Boolean * 
  1:pushscope
                        stack:
                        scope: [global Object$ flash.events::EventDispatcher$ flash.display::DisplayObject$ flash.display::InteractiveObject$ flash.display::DisplayObjectContainer$ flash.display::Sprite$ TestJustUserInfoInstantiation$] TestJustUserInfoInstantiation 
                         locals: TestJustUserInfoInstantiation String? String? Boolean * 
  2:findpropstrict SomeClass
                        stack: global
                        scope: [global Object$ flash.events::EventDispatcher$ flash.display::DisplayObject$ flash.display::InteractiveObject$ flash.display::DisplayObjectContainer$ flash.display::Sprite$ TestJustUserInfoInstantiation$] TestJustUserInfoInstantiation 
                         locals: TestJustUserInfoInstantiation String? String? Boolean * 
  4:constructprop 3 0
                        stack: SomeClass
                        scope: [global Object$ flash.events::EventDispatcher$ flash.display::DisplayObject$ flash.display::InteractiveObject$ flash.display::DisplayObjectContainer$ flash.display::Sprite$ TestJustUserInfoInstantiation$] TestJustUserInfoInstantiation 
                         locals: TestJustUserInfoInstantiation String? String? Boolean * 
  7:coerce SomeClass
                        stack: SomeClass
                        scope: [global Object$ flash.events::EventDispatcher$ flash.display::DisplayObject$ flash.display::InteractiveObject$ flash.display::DisplayObjectContainer$ flash.display::Sprite$ TestJustUserInfoInstantiation$] TestJustUserInfoInstantiation 
                         locals: TestJustUserInfoInstantiation String? String? Boolean * 
  9:dup
VerifyError: Error #1023: Stack overflow occurred.

    at TestJustUserInfoInstantiation/onAddedToStage()

```

If I take out the third argument to the function, I don’t get the error.  
If I set a property on info before returning it…

```auto
private function makeUserInfo(firstName:String, lastName:String, thirdly:Boolean=false):SomeClass{
    var info:SomeClass = new SomeClass();
[COLOR=#ff0000] info.aProp = 7;[/COLOR]
    return info;
}

```

… I don’t get the error. I know the code as I have it here doesn’t make a lot of sense, but I’ve just stripped it down to isolate the issue.  
Can anyone explain what’s going on?
