About Monkey 2 › Forums › Monkey 2 Development › memory access violation with vec2f
This topic contains 3 replies, has 3 voices, and was last updated by 
 Mark Sibly
 2 years, 8 months ago.
- 
		AuthorPosts
 - 
		
			
				
August 13, 2016 at 6:00 am #2961
Mark, this was brought to me and confirmed with both ted21 and ted2, so I am assuming it is a proper bug:
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778Namespace myapp#Import "<std>"#Import "<mojo>"Using std..Using mojo..Class MyWindow Extends WindowMethod New()Local FrameSetCollection:StringMap<FrameSet> = New StringMap<FrameSet>()Local player:Player = New Player(FrameSetCollection, "Bla", 200, 300)EndMethod OnRender( canvas:Canvas ) Overridecanvas.DrawText( "Hello World",Width/2,Height/2,.5,.5 )EndEndFunction Main()New AppInstanceNew MyWindowApp.Run()EndClass FrameSetField Position:= New Vec2fField Vector:= New Vector()Method Move:Void(_mx:Float, _my:Float)' Print _mx' Print _my' HERE IS THE ERROR, CREATING NEW VEC2F''Position=New Vec2f' Vector.x = 2' Vector.Set(3)' Position = New Vec2f(_mx,_my)EndEnd ClassClass SpriteField FrameSetCollection:StringMap<FrameSet>Field FrameSetColKey:StringMethod New(_FrameSetCollection:StringMap<FrameSet>,_FrameSetColKey:String)FrameSetCollection = _FrameSetCollectionFrameSetColKey = _FrameSetColKey' FrameSetCollection.Add(FrameSetColKey, New FrameSet)EndEnd ClassClass VectorField x:FloatMethod Set(_x:Float)x= _xEndEnd ClassClass Player Extends SpriteMethod New(_FrameSetCollection:StringMap<FrameSet>,_FrameSetColKey:String,_initX:Float,_initY:Float)Super.New(_FrameSetCollection,_FrameSetColKey)_FrameSetCollection.Get(_FrameSetColKey).Move(_initX,_initY)EndEnd ClassThe offending line is found in Frameset:
Monkey123Position=New Vec2fAugust 13, 2016 at 7:11 am #2962No AdamStrang,
You asked for a code that crashes ted21 editor, so that’s why I gave you that code.
I know how to solve that error in that script I gave you, because I asked that here a week ago.
http://monkey2.monkey-x.com/forums/topic/new-vec2f-not-working-inside-new-constructor/Ted21 crashes the second time when I run a “error generated script” after not stopping the debug process (red button, in debug view) first.
Even when you use debugStop() in a good working script.
I test it now it the original ted2 and it does the same.
August 13, 2016 at 7:27 am #2963mmm, so it’s not the script it’s mx2cc behaviour? I’m not sure if that’s a good/fair test or not?
I will agree that it is an error that isn’t being caught, but it’s not the editor that is at fault – I might be wrong on this though?
August 13, 2016 at 8:33 am #2964This is working here in the latest Ted2, ie: the debugger catches the error, highlights it, stops when you hit ‘stop’, and works again and again.
I have tweaked the guts of DebugView a bit so I may have fixed something along the way…
New stuff should be up tomorrow or Monday – just want to give everything a bit of a thrashing first.
 - 
		AuthorPosts
 
You must be logged in to reply to this topic.