HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

UnInited locals

01-23-2007, 02:21 PM#1
DioD
Code:
function ThreadCrush takes nothing returns nothing
    local integer I
    set I = I + 1
endfunction

will crush thread

this is complete useless, but this is only way to instant stop running thread
01-23-2007, 02:25 PM#2
Jazradel
This bug is a serious pain in the ass. It always takes me ages to figure out the problem when I do this.

I know this happens with integers (reals too presumeably) but does it happen with booleans and strings? I've never actually tested it.
01-23-2007, 02:35 PM#3
blu_da_noob
This is as old as the hills. Was there really any need to repost it?

Quote:
I know this happens with integers (reals too presumeably) but does it happen with booleans and strings? I've never actually tested it.

It happens with any type of variable. If an uninitialised variable is used in anything but an assignment call, it will crash the thread.
01-23-2007, 02:42 PM#4
Jazradel
Thanks, I guess I should have known that.
01-23-2007, 03:05 PM#5
Vexorian
What is pretty odd is that arrays don't need initializing, they get default values already and don't crash the thread. This annoying bug is a non-issue when you run grimoire's war3err
01-23-2007, 08:15 PM#6
PipeDream
Quote:
this is only way to instant stop running thread
divide by zero works too
01-24-2007, 09:40 AM#7
Toadcop
Quote:
divide by zero works too
wow ! i thinked for this blizz have maked some checks... but it's nothing new what blizz have genail art to code =)
01-24-2007, 10:43 AM#8
PipeDream
Yes, there are special exits that the VM follows when those things are going to happen, which is what war3err hooks into.

Edit: BTW, grimoire only hooks about half of them, so there should be a few more with unknown purpose...