Ignore:
Timestamp:
Mar 18, 2012, 8:34:29 PM (13 years ago)
Author:
dmik
Message:

kernel32: Fix crash in CreateThread() (r21981 regression).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/thread.cpp

    r21981 r21983  
    698698    DWORD            rc;
    699699    TEB             *winteb    = (TEB *)me->teb;
    700 
     700    DWORD            cbCommitStack = me->cbCommitStack;
     701
     702    // @todo the approach to copy all fields to local vars and delete the
     703    // instance is dumb, fix it later
    701704    delete(me);    //only called once
     705    me = 0;
    702706
    703707    if(InitializeThread(winteb) == FALSE) {
     
    723727    dprintf(("Stack top 0x%x, stack end 0x%x", winteb->stack_top, winteb->stack_low));
    724728
    725     if (me->cbCommitStack) {
     729    if (cbCommitStack) {
    726730        // pre-commit part of the stack
     731        dprintf(("Pre-commit 0x%x bytes of stack", me->cbCommitStack));
    727732        PBYTE stack = ((PBYTE) (winteb->stack_top)) - 1;
    728733        for (int i = 0; i < (me->cbCommitStack + 0xFFF) / 0x1000; i++) {
Note: See TracChangeset for help on using the changeset viewer.