.hgignore
author Sam Lantinga <slouken@libsdl.org>
Thu, 16 May 2013 00:43:22 -0700
changeset 7180 3733e68edbc3
parent 6958 3aecdfd1c68b
child 7232 6f17d930be39
permissions -rw-r--r--
Fixed bug 1846 - _allmul implementation in SDL_stdlib.c doesn't clean up the stack

Colin Barrett

I see this manifest itself (VS2012 x86) as:

"Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention."

in the first call to SDL_GetTicks in my application. The disassembly at the problem line is:

hires_now.QuadPart *= 1000;
00AD0792 push 0
00AD0794 push 3E8h
00AD0799 mov eax,dword ptr [ebp-10h]
00AD079C push eax
00AD079D mov ecx,dword ptr [hires_now]
00AD07A0 push ecx
00AD07A1 call _allmul (0AE7D40h)
00AD07A6 mov dword ptr [hires_now],eax
00AD07A9 mov dword ptr [ebp-10h],edx

Apparently _allmul should be popping the stack but isn't (other similar functions in SDL_stdlib.c - _alldiv and whatnot - DO pop the stack).

A 'ret 10h' at the end of _allmul appears to do the trick
icculus@4418
     1
syntax:glob
slouken@6328
     2
.svn
icculus@4418
     3
autom4te*
icculus@4418
     4
config.cache
icculus@4418
     5
config.log
icculus@4418
     6
config.status
icculus@4418
     7
Makefile
icculus@4418
     8
sdl-config
slouken@6250
     9
SDL2.spec
icculus@4418
    10
build
slouken@5318
    11
ewing@4466
    12
# for Xcode
ewing@4466
    13
*.orig
ewing@4466
    14
*.swp
ewing@4466
    15
*.tmp
ewing@4466
    16
*.rej
ewing@4466
    17
*~
ewing@4466
    18
*.o
ewing@4466
    19
*.mode1*
ewing@4466
    20
*.model*
ewing@4466
    21
*.perspective*
ewing@4466
    22
*.perspective*
ewing@4466
    23
*.pbxuser
ewing@4466
    24
(^|/)build($|/)
icculus@4418
    25
.DS_Store
stopiccot@6681
    26
Xcode/SDL/SDL.xcodeproj/xcuserdata
slouken@6859
    27
Xcode/SDL/SDL.xcodeproj/project.xcworkspace
slouken@6859
    28
Xcode/SDLTest/SDLTest.xcodeproj/xcuserdata
slouken@6859
    29
Xcode/SDLTest/SDLTest.xcodeproj/project.xcworkspace
slouken@6859
    30
Xcode-iOS/SDL/SDL.xcodeproj/xcuserdata
slouken@6859
    31
Xcode-iOS/SDL/SDL.xcodeproj/project.xcworkspace
slouken@6859
    32
Xcode-iOS/Demos/Demos.xcodeproj/xcuserdata
slouken@6859
    33
Xcode-iOS/Demos/Demos.xcodeproj/project.xcworkspace
slouken@5318
    34
slouken@5318
    35
# for Visual C++
slouken@5318
    36
Debug
slouken@5318
    37
Release
slouken@5318
    38
*.user
slouken@5318
    39
*.ncb
slouken@5318
    40
*.suo
slouken@5318
    41
slouken@6907
    42
# for Android
slouken@6907
    43
android-project/local.properties
slouken@6907
    44
icculus@4418
    45
sdl.pc
icculus@4418
    46
test/autom4te*
icculus@4418
    47
test/config.cache
icculus@4418
    48
test/config.log
icculus@4418
    49
test/config.status
icculus@4418
    50
test/Makefile
slouken@6250
    51
test/SDL2.dll
icculus@4418
    52
test/checkkeys
icculus@4418
    53
test/loopwave
slouken@4862
    54
test/testatomic
slouken@4862
    55
test/testaudioinfo
slouken@6958
    56
test/testautomation
slouken@4862
    57
test/testdraw2
icculus@4418
    58
test/testerror
icculus@4418
    59
test/testfile
slouken@6958
    60
test/testgamecontroller
slouken@4862
    61
test/testgesture
slouken@4862
    62
test/testgl2
slouken@4862
    63
test/testgles
slouken@4862
    64
test/testhaptic
icculus@4418
    65
test/testiconv
slouken@4862
    66
test/testime
slouken@4862
    67
test/testintersections
icculus@4418
    68
test/testjoystick
icculus@4418
    69
test/testkeys
slouken@4862
    70
test/testloadso
icculus@4418
    71
test/testlock
slouken@6658
    72
test/testmessage
slouken@4862
    73
test/testmultiaudio
slouken@6286
    74
test/testnative
icculus@4418
    75
test/testoverlay2
icculus@4418
    76
test/testplatform
slouken@4862
    77
test/testpower
slouken@6517
    78
test/testrelative
slouken@6517
    79
test/testrendercopyex
slouken@6286
    80
test/testrendertarget
slouken@4862
    81
test/testresample
slouken@5453
    82
test/testrumble
slouken@5318
    83
test/testscale
icculus@4418
    84
test/testsem
slouken@5318
    85
test/testshader
slouken@5318
    86
test/testshape
slouken@4862
    87
test/testsprite2
slouken@4862
    88
test/testspriteminimal
slouken@5318
    89
test/teststreaming
slouken@6286
    90
test/testthread
icculus@4418
    91
test/testtimer
icculus@4418
    92
test/testver
slouken@4862
    93
test/testwm2
icculus@4418
    94
test/torturethread
icculus@4418
    95
test/*.exe
icculus@4418
    96
test/*.dSYM