There is a bug in the dwtoa function from the masm32 lib. It occurs when dwValue is 0:


....
push ebx
push esi
push edi

mov eax, dwValue
mov edi, [lpBuffer]

or eax,eax
jnz sign

zero:
mov word ptr [edi],30h
[b] pop edi
pop esi
pop ebx[/b]
ret


The bold lines are missing.

Thomas
Posted on 2002-01-06 11:05:39 by Thomas
Thomas,

Thanks for finding this bug, its not one that I wrote and I missed it but it will be fixed in the next release.

Regards,

hutch@movsd.com
Posted on 2002-01-07 05:23:27 by hutch--
I get a kick out of "stupid" bugs like this.

A good example of why to use a common exit. Or at least USES...

:) :)
Posted on 2002-01-07 21:19:33 by S/390
That's right!!!

Not only "dwtoa" but also "USES" has a bug, i felt.

so i don't trust "USES", just use "push", and "pop" manually.
Posted on 2002-01-24 19:52:10 by muzidowa
Not only "dwtoa" but also "USES" has a bug, i felt


I never had problems with uses, can you give an example? It's safer than using push & pop as it pops all registers back on every ret automatically, something you tend to forget when not using 'uses' as you can see in the dwtoa function.

Thomas
Posted on 2002-01-25 01:16:48 by Thomas
Thomas,

Unfortunately, I forgot that case.

last year, when I was debugging my app, found that.

sorry... but in some case "uses" untrustable...
Posted on 2002-01-25 01:30:25 by muzidowa