Sfoglia il codice sorgente

Reworked after re-re-review.

Signed-off-by: Attila Vamos <attila.vamos@gmail.com>
Attila Vamos 12 anni fa
parent
commit
67a7ff8622
1 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. 5 2
      rtl/eclrtl/eclrtl.cpp

+ 5 - 2
rtl/eclrtl/eclrtl.cpp

@@ -66,7 +66,10 @@ MODULE_EXIT()
 // Miscellaneous string functions...
 ECLRTL_API void * rtlMalloc(size32_t size)
 {
-    void * retVal = malloc(size);
+    void * retVal = NULL;
+
+    if( 0 != size )
+        retVal = malloc(size);
 
     if( NULL == retVal)
     {
@@ -3712,7 +3715,7 @@ void rtlSysFail(int code, const char *msg)
 
 void rtlThrowOutOfMemory(int code, const char *msg)
 {
-    throw dynamic_cast<IUserException *>(new CRtlFailException(code, msg));
+    throw static_cast<IUserException *>(new CRtlFailException(code, msg));
 }
 
 void rtlReportRowOverflow(unsigned size, unsigned max)