Last active
October 12, 2015 06:38
-
-
Save DexterHaslem/3985866 to your computer and use it in GitHub Desktop.
asdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// doesn't crash with const int param | |
//IntProxy inc(const int) | |
IntProxy inc(int) | |
{ | |
000007F6A5DC3370 mov dword ptr [rsp+18h],r8d | |
000007F6A5DC3375 mov qword ptr [rsp+10h],rdx | |
000007F6A5DC337A mov qword ptr [rsp+8],rcx | |
000007F6A5DC337F push rdi | |
000007F6A5DC3380 sub rsp,40h | |
000007F6A5DC3384 mov rdi,rsp | |
000007F6A5DC3387 mov ecx,10h | |
000007F6A5DC338C mov eax,0CCCCCCCCh | |
000007F6A5DC3391 rep stos dword ptr [rdi] | |
000007F6A5DC3393 mov rcx,qword ptr [this] | |
// 000000013FAA1040 inc dword ptr [rcx] | |
// 000000013FAA1042 mov eax,dword ptr [rcx] | |
m_value++; | |
000007F6A5DC3398 mov rax,qword ptr [this] | |
000007F6A5DC339D mov eax,dword ptr [rax] | |
000007F6A5DC339F inc eax | |
000007F6A5DC33A1 mov rcx,qword ptr [this] | |
// 000000013FAA1040 inc dword ptr [rcx] | |
// 000000013FAA1042 mov eax,dword ptr [rcx] | |
m_value++; | |
000007F6A5DC33A6 mov dword ptr [rcx],eax | |
// 000000013F8D1044 dec eax | |
// CRASH HERE: rdx is never given a valid address | |
// 000000013F8D1046 mov dword ptr [rdx],eax | |
IntProxy result = MakeIntProxy(m_value - 1); | |
000007F6A5DC33A8 mov rax,qword ptr [this] | |
000007F6A5DC33AD mov eax,dword ptr [rax] | |
000007F6A5DC33AF dec eax | |
000007F6A5DC33B1 mov ecx,eax | |
000007F6A5DC33B3 call IntProxy::MakeIntProxy (07F6A5DC10CDh) | |
000007F6A5DC33B8 mov dword ptr [rsp+34h],eax | |
000007F6A5DC33BC mov eax,dword ptr [rsp+34h] | |
000007F6A5DC33C0 mov dword ptr [result],eax | |
// 000000013FAA104B ret | |
return result; | |
000007F6A5DC33C4 mov rax,qword ptr [rsp+58h] | |
000007F6A5DC33C9 mov ecx,dword ptr [result] | |
000007F6A5DC33CD mov dword ptr [rax],ecx | |
000007F6A5DC33CF mov rax,qword ptr [rsp+58h] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment