Ignore:
Timestamp:
Jul 7, 2012, 1:59:15 AM (13 years ago)
Author:
dmik
Message:

kernel32: Pick up register changes in try/except filter.

This is a regression of r21999. Fixes endless exceptions eventually
leading to program termination.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/seh/sehutil.s

    r21999 r22004  
    154154    popl %ebp
    155155
     156    /* analyze filter result */
     157    movl 20(%ebx), %eax /* pFrame->filterResult */
     158    cmpl $1, %eax /* EXCEPTION_EXECUTE_HANDLER? */
     159    je ___seh_handler_FreeMem
     160    cmpl $-1, %eax /* EXCEPTION_CONTINUE_EXECUTION? */
     161    jne 1f
     162    movl $0, %eax /* ExceptionContinueExecution */
     163    jmp 2f
     1641:
     165    /* Assume EXCEPTION_CONTIUNE_SEARCH */
     166    movl $1, %eax /* ExceptionContinueSearch */
     1672:
     168
     169    /* convert Win32 exception info back to OS/2 */
     170    pushl 16(%ebp)               /* pContext */
     171    pushl 48(%ebx)               /* pFrame->Pointers.ContextRecord */
     172    pushl %eax                   /* rc */
     173    call OSLibConvertExceptionResult
     174    addl $12, %esp
     175    pushl %eax /* save result */
     176
     177___seh_handler_FreeMem:
     178
    156179    /* free heap block */
    157180    movl 16(%ebx), %eax /* pFrame->pHandlerContext */
     
    161184    addl $4, %esp
    162185
    163     /* analyze filter result */
     186    /* analyze filter result again */
    164187    movl 20(%ebx), %eax /* pFrame->filterResult */
    165188    cmpl $1, %eax /* EXCEPTION_EXECUTE_HANDLER? */
    166189    je ___seh_handler_Unwind
    167     cmpl $-1, %eax /* EXCEPTION_CONTINUE_EXECUTION? */
    168     jne 1f
     190
     191    popl %eax /* restore OSLibConvertExceptionResult result */
     192
     193    /* %eax already contains TRUE if the execution should continue
     194     * and FALSE otherwise */
     195    cmp $0, %eax /* FALSE (= continue search)? */
     196    je 1f
    169197    movl $0, 52(%ebx) /* pFrame->state */
    170     //movl $-1, %eax /* XCPT_CONTINUE_EXECUTION (-1) */
    171     movl $1, %eax
     198    movl $1, %eax /* TRUE */
    172199    jmp ___seh_handler_Return
    1732001:
    174     /* assume EXCEPTION_CONTINUE_SEARCH (0) */
    175     xorl %eax, %eax /* return XCPT_CONTINUE_SEARCH (0) */
     201    xorl %eax, %eax /* FALSE */
    176202    jmp ___seh_handler_Return
    177203
Note: See TracChangeset for help on using the changeset viewer.