.file "bug.cpp" .text .align 2 .globl _ZN6StringpLERKS_ .type _ZN6StringpLERKS_,@function _ZN6StringpLERKS_: .LFB1: pushl %ebp .LCFI0: movl %esp, %ebp .LCFI1: subl $8, %esp .LCFI2: subl $8, %esp movl 12(%ebp), %eax pushl (%eax) pushl 8(%ebp) .LCFI3: call _ZN6StringpLEPKc addl $16, %esp leave ret .LFE1: .Lfe1: .size _ZN6StringpLERKS_,.Lfe1-_ZN6StringpLERKS_ .align 2 .globl _ZN6StringpLEPKc .type _ZN6StringpLEPKc,@function _ZN6StringpLEPKc: .LFB2: pushl %ebp .LCFI4: movl %esp, %ebp .LCFI5: subl $24, %esp .LCFI6: subl $12, %esp pushl 8(%ebp) .LCFI7: call _ZN6String6lengthEv addl $16, %esp movl %eax, -4(%ebp) subl $12, %esp pushl 12(%ebp) call _ZN6String6strlenEPKc addl $16, %esp movl %eax, -8(%ebp) cmpl $0, -8(%ebp) je .L3 subl $12, %esp movl -8(%ebp), %eax addl -4(%ebp), %eax incl %eax pushl %eax call _Znaj addl $16, %esp movl %eax, -12(%ebp) movl 8(%ebp), %eax cmpl $0, (%eax) je .L4 subl $8, %esp movl 8(%ebp), %eax pushl (%eax) pushl -12(%ebp) call _ZN6String6strcpyEPcPKc addl $16, %esp .L4: subl $8, %esp pushl 12(%ebp) movl -4(%ebp), %eax addl -12(%ebp), %eax pushl %eax call _ZN6String6strcpyEPcPKc addl $16, %esp movl 8(%ebp), %eax cmpl $0, (%eax) je .L5 movl 8(%ebp), %eax cmpl $0, (%eax) je .L5 subl $12, %esp movl 8(%ebp), %eax pushl (%eax) call _ZdaPv addl $16, %esp .L5: movl 8(%ebp), %edx movl -12(%ebp), %eax movl %eax, (%edx) .L3: movl 8(%ebp), %eax leave ret .LFE2: .Lfe2: .size _ZN6StringpLEPKc,.Lfe2-_ZN6StringpLEPKc .align 2 .globl _ZN6String6strlenEPKc .type _ZN6String6strlenEPKc,@function _ZN6String6strlenEPKc: .LFB3: pushl %ebp .LCFI8: movl %esp, %ebp .LCFI9: subl $8, %esp .LCFI10: cmpl $0, 8(%ebp) jne .L9 movl $0, -8(%ebp) jmp .L8 .L9: movl 8(%ebp), %eax movl %eax, -4(%ebp) .L10: movl 8(%ebp), %eax cmpb $0, (%eax) jne .L12 jmp .L11 .L12: incl 8(%ebp) jmp .L10 .L11: movl -4(%ebp), %eax movl 8(%ebp), %edx subl %eax, %edx movl %edx, %eax movl %eax, -8(%ebp) .L8: movl -8(%ebp), %eax leave ret .LFE3: .Lfe3: .size _ZN6String6strlenEPKc,.Lfe3-_ZN6String6strlenEPKc .align 2 .globl _ZN6String6strcpyEPcPKc .type _ZN6String6strcpyEPcPKc,@function _ZN6String6strcpyEPcPKc: .LFB4: pushl %ebp .LCFI11: movl %esp, %ebp .LCFI12: nop .L14: movl 8(%ebp), %eax movl %eax, %ecx movl 12(%ebp), %eax movb (%eax), %dl movb %dl, (%ecx) leal 12(%ebp), %eax incl (%eax) incl 8(%ebp) testb %dl, %dl jne .L14 popl %ebp ret .LFE4: .Lfe4: .size _ZN6String6strcpyEPcPKc,.Lfe4-_ZN6String6strcpyEPcPKc .align 2 .globl _Z6tester6String .type _Z6tester6String,@function _Z6tester6String: .LFB5: pushl %ebp .LCFI13: movl %esp, %ebp .LCFI14: popl %ebp ret .LFE5: .Lfe5: .size _Z6tester6String,.Lfe5-_Z6tester6String .globl _Unwind_Resume .section .rodata .LC0: .string "bug" .LC1: .string "ops: " .text .align 2 .globl main .type main,@function main: .LFB6: pushl %ebp .LCFI15: movl %esp, %ebp .LCFI16: pushl %ebx .LCFI17: subl $52, %esp .LCFI18: andl $-16, %esp movl $0, %eax subl %eax, %esp subl $8, %esp pushl $.LC0 leal -24(%ebp), %eax pushl %eax .LEHB0: .LCFI19: call _ZN6StringC1EPKc .LEHE0: addl $16, %esp .L19: leal -40(%ebp), %edx subl $4, %esp leal -24(%ebp), %eax pushl %eax pushl $.LC1 pushl %edx .LEHB1: call _ZplPKcRK6String .LEHE1: addl $12, %esp subl $12, %esp leal -40(%ebp), %eax pushl %eax call _Z6tester6String addl $16, %esp jmp .L19 .L26: movl %eax, -44(%ebp) movl -44(%ebp), %ebx subl $12, %esp leal -24(%ebp), %eax pushl %eax call _ZN6StringD1Ev addl $16, %esp movl %ebx, -44(%ebp) subl $12, %esp pushl -44(%ebp) .LEHB2: call _Unwind_Resume .LEHE2: .LFE6: .Lfe6: .size main,.Lfe6-main .section .gcc_except_table,"aw",@progbits .LLSDA6: .byte 0xff .byte 0xff .byte 0x1 .uleb128 .LLSDACSE6-.LLSDACSB6 .LLSDACSB6: .uleb128 .LEHB0-.LFB6 .uleb128 .LEHE0-.LEHB0 .uleb128 0x0 .uleb128 0x0 .uleb128 .LEHB1-.LFB6 .uleb128 .LEHE1-.LEHB1 .uleb128 .L26-.LFB6 .uleb128 0x0 .uleb128 .LEHB2-.LFB6 .uleb128 .LEHE2-.LEHB2 .uleb128 0x0 .uleb128 0x0 .LLSDACSE6: .text .section .gnu.linkonce.t._ZN6StringC1EPKc,"ax",@progbits .align 2 .weak _ZN6StringC1EPKc .type _ZN6StringC1EPKc,@function _ZN6StringC1EPKc: .LFB7: pushl %ebp .LCFI20: movl %esp, %ebp .LCFI21: pushl %ebx .LCFI22: subl $4, %esp .LCFI23: movl 8(%ebp), %ebx subl $12, %esp pushl 12(%ebp) .LCFI24: call _ZN6String6strlenEPKc addl $4, %esp incl %eax pushl %eax .LCFI25: call _Znaj addl $16, %esp movl %eax, (%ebx) subl $8, %esp pushl 12(%ebp) movl 8(%ebp), %eax pushl (%eax) call _ZN6String6strcpyEPcPKc addl $16, %esp movl -4(%ebp), %ebx leave ret .LFE7: .Lfe7: .size _ZN6StringC1EPKc,.Lfe7-_ZN6StringC1EPKc .section .gnu.linkonce.t._ZN6StringD1Ev,"ax",@progbits .align 2 .weak _ZN6StringD1Ev .type _ZN6StringD1Ev,@function _ZN6StringD1Ev: .LFB8: pushl %ebp .LCFI26: movl %esp, %ebp .LCFI27: subl $8, %esp .LCFI28: movl 8(%ebp), %eax cmpl $0, (%eax) je .L28 movl 8(%ebp), %eax cmpl $0, (%eax) je .L28 subl $12, %esp movl 8(%ebp), %eax pushl (%eax) .LCFI29: call _ZdaPv addl $16, %esp .L28: leave ret .LFE8: .Lfe8: .size _ZN6StringD1Ev,.Lfe8-_ZN6StringD1Ev .section .gnu.linkonce.t._ZN6String6lengthEv,"ax",@progbits .align 2 .weak _ZN6String6lengthEv .type _ZN6String6lengthEv,@function _ZN6String6lengthEv: .LFB9: pushl %ebp .LCFI30: movl %esp, %ebp .LCFI31: subl $8, %esp .LCFI32: subl $12, %esp movl 8(%ebp), %eax pushl (%eax) .LCFI33: call _ZN6String6strlenEPKc addl $16, %esp leave ret .LFE9: .Lfe9: .size _ZN6String6lengthEv,.Lfe9-_ZN6String6lengthEv .section .gnu.linkonce.t._ZplPKcRK6String,"ax",@progbits .align 2 .weak _ZplPKcRK6String .type _ZplPKcRK6String,@function _ZplPKcRK6String: .LFB10: pushl %ebp .LCFI34: movl %esp, %ebp .LCFI35: pushl %ebx .LCFI36: subl $4, %esp .LCFI37: subl $8, %esp pushl 12(%ebp) pushl 8(%ebp) .LEHB3: .LCFI38: call _ZN6StringC1EPKc .LEHE3: addl $16, %esp subl $8, %esp pushl 16(%ebp) pushl 8(%ebp) .LEHB4: call _ZN6StringpLERKS_ .LEHE4: addl $16, %esp jmp .L35 .L40: movl %eax, -8(%ebp) movl -8(%ebp), %ebx subl $12, %esp pushl 8(%ebp) call _ZN6StringD1Ev addl $16, %esp movl %ebx, -8(%ebp) subl $12, %esp pushl -8(%ebp) .LEHB5: call _Unwind_Resume .LEHE5: .L35: movl 8(%ebp), %eax movl -4(%ebp), %ebx leave ret $4 .LFE10: .Lfe10: .size _ZplPKcRK6String,.Lfe10-_ZplPKcRK6String .section .gcc_except_table .LLSDA10: .byte 0xff .byte 0xff .byte 0x1 .uleb128 .LLSDACSE10-.LLSDACSB10 .LLSDACSB10: .uleb128 .LEHB3-.LFB10 .uleb128 .LEHE3-.LEHB3 .uleb128 0x0 .uleb128 0x0 .uleb128 .LEHB4-.LFB10 .uleb128 .LEHE4-.LEHB4 .uleb128 .L40-.LFB10 .uleb128 0x0 .uleb128 .LEHB5-.LFB10 .uleb128 .LEHE5-.LEHB5 .uleb128 0x0 .uleb128 0x0 .LLSDACSE10: .section .gnu.linkonce.t._ZplPKcRK6String .section .eh_frame,"aw",@progbits .Lframe1: .long .LECIE1-.LSCIE1 .LSCIE1: .long 0x0 .byte 0x1 .string "zPL" .uleb128 0x1 .sleb128 -4 .byte 0x8 .uleb128 0x6 .byte 0x0 .long __gxx_personality_v0 .byte 0x0 .byte 0xc .uleb128 0x4 .uleb128 0x4 .byte 0x88 .uleb128 0x1 .align 4 .LECIE1: .LSFDE1: .long .LEFDE1-.LASFDE1 .LASFDE1: .long .LASFDE1-.Lframe1 .long .LFB1 .long .LFE1-.LFB1 .uleb128 0x4 .long 0x0 .byte 0x4 .long .LCFI0-.LFB1 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI1-.LCFI0 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI3-.LCFI1 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE1: .LSFDE3: .long .LEFDE3-.LASFDE3 .LASFDE3: .long .LASFDE3-.Lframe1 .long .LFB2 .long .LFE2-.LFB2 .uleb128 0x4 .long 0x0 .byte 0x4 .long .LCFI4-.LFB2 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI5-.LCFI4 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI7-.LCFI5 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE3: .LSFDE11: .long .LEFDE11-.LASFDE11 .LASFDE11: .long .LASFDE11-.Lframe1 .long .LFB6 .long .LFE6-.LFB6 .uleb128 0x4 .long .LLSDA6 .byte 0x4 .long .LCFI15-.LFB6 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI16-.LCFI15 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI18-.LCFI16 .byte 0x83 .uleb128 0x3 .byte 0x4 .long .LCFI19-.LCFI18 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE11: .LSFDE13: .long .LEFDE13-.LASFDE13 .LASFDE13: .long .LASFDE13-.Lframe1 .long .LFB7 .long .LFE7-.LFB7 .uleb128 0x4 .long 0x0 .byte 0x4 .long .LCFI20-.LFB7 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI21-.LCFI20 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI23-.LCFI21 .byte 0x83 .uleb128 0x3 .byte 0x4 .long .LCFI24-.LCFI23 .byte 0x2e .uleb128 0x4 .byte 0x4 .long .LCFI25-.LCFI24 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE13: .LSFDE19: .long .LEFDE19-.LASFDE19 .LASFDE19: .long .LASFDE19-.Lframe1 .long .LFB10 .long .LFE10-.LFB10 .uleb128 0x4 .long .LLSDA10 .byte 0x4 .long .LCFI34-.LFB10 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI35-.LCFI34 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI37-.LCFI35 .byte 0x83 .uleb128 0x3 .byte 0x4 .long .LCFI38-.LCFI37 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE19: .ident "GCC: (GNU) 3.2"