Mercurial > projects > ddmd
diff dmd/backend/iasm.d @ 5:63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
author | dkoroskin <> |
---|---|
date | Tue, 08 Dec 2009 21:39:17 +0300 |
parents | d706d958e4e8 |
children | 2cc604139636 |
line wrap: on
line diff
--- a/dmd/backend/iasm.d Mon Oct 26 16:28:19 2009 +0300 +++ b/dmd/backend/iasm.d Tue Dec 08 21:39:17 2009 +0300 @@ -45,6 +45,7 @@ import core.stdc.stdio : printf; import core.stdc.string : strlen; +import core.stdc.stdlib : realloc; import core.stdc.limits; import std.bitmanip; @@ -1872,7 +1873,7 @@ if (usBytes+usSize > usMaxbytes) { usMaxbytes = usBytes + usSize + 10; - c.IEV1.as.bytes = cast(char*)GC.realloc(c.IEV1.as.bytes,usMaxbytes); + c.IEV1.as.bytes = cast(char*)realloc(c.IEV1.as.bytes,usMaxbytes); } switch (tok_value) { @@ -1932,7 +1933,7 @@ if (len) { usMaxbytes += len * usSize; - c.IEV1.as.bytes = cast(char*)GC.realloc(c.IEV1.as.bytes,usMaxbytes); + c.IEV1.as.bytes = cast(char*)realloc(c.IEV1.as.bytes,usMaxbytes); memcpy(c.IEV1.as.bytes + usBytes,asmtok.ustring,len); char* p = c.IEV1.as.bytes + usBytes;