Assign malloc results in test to variables.

This commit is contained in:
Cornelius Riemenschneider
2020-04-23 15:16:08 +02:00
parent 230e5a3a9a
commit 203315ae33
2 changed files with 15 additions and 14 deletions

View File

@@ -151,13 +151,14 @@ void directOperatorCall() {
}
void *malloc(size_t);
typedef int* ptr_int;
void testMalloc(size_t count) {
malloc(5);
malloc(5 * sizeof(int));
malloc(count);
malloc(count * sizeof(int));
malloc(count * sizeof(int) + 1);
malloc(((int) count) * sizeof(void *));
malloc(sizeof(void*) * sizeof(int));
const volatile int *i = (const volatile int *) malloc(5);
ptr_int i2 = (ptr_int) malloc(5 * sizeof(int));
volatile long *l = (long *) malloc(count);
l = (long *) malloc(count * sizeof(int));
const char* c = (const char *) malloc(count * sizeof(int) + 1);
void * v = (void *) malloc(((int) count) * sizeof(void *));
malloc(sizeof(void *) * sizeof(int));
}

View File

@@ -85,13 +85,13 @@ allocationExprs
| allocators.cpp:143:13:143:28 | new[] | getSizeBytes = 400, requiresDealloc |
| allocators.cpp:144:13:144:31 | new[] | getSizeExpr = x, getSizeMult = 900, requiresDealloc |
| allocators.cpp:149:8:149:19 | call to operator new | getSizeBytes = 4, getSizeExpr = sizeof(int), getSizeMult = 1, requiresDealloc |
| allocators.cpp:156:3:156:8 | call to malloc | getSizeBytes = 5, getSizeExpr = 5, getSizeMult = 1, requiresDealloc |
| allocators.cpp:157:3:157:8 | call to malloc | getSizeBytes = 20, getSizeExpr = 5, getSizeMult = 4, requiresDealloc |
| allocators.cpp:158:3:158:8 | call to malloc | getSizeExpr = count, getSizeMult = 1, requiresDealloc |
| allocators.cpp:159:3:159:8 | call to malloc | getSizeExpr = count, getSizeMult = 4, requiresDealloc |
| allocators.cpp:160:3:160:8 | call to malloc | getSizeExpr = ... + ..., getSizeMult = 1, requiresDealloc |
| allocators.cpp:161:3:161:8 | call to malloc | getSizeExpr = count, getSizeMult = 8, requiresDealloc |
| allocators.cpp:162:3:162:8 | call to malloc | getSizeBytes = 32, getSizeExpr = ... * ..., getSizeMult = 1, requiresDealloc |
| allocators.cpp:157:50:157:55 | call to malloc | getSizeBytes = 5, getSizeExpr = 5, getSizeMult = 1, requiresDealloc |
| allocators.cpp:158:26:158:31 | call to malloc | getSizeBytes = 20, getSizeExpr = 5, getSizeMult = 4, requiresDealloc |
| allocators.cpp:159:31:159:36 | call to malloc | getSizeExpr = count, getSizeMult = 1, requiresDealloc |
| allocators.cpp:160:16:160:21 | call to malloc | getSizeExpr = count, getSizeMult = 4, requiresDealloc |
| allocators.cpp:161:34:161:39 | call to malloc | getSizeExpr = ... + ..., getSizeMult = 1, requiresDealloc |
| allocators.cpp:162:23:162:28 | call to malloc | getSizeExpr = count, getSizeMult = 8, requiresDealloc |
| allocators.cpp:163:3:163:8 | call to malloc | getSizeBytes = 32, getSizeExpr = ... * ..., getSizeMult = 1, requiresDealloc |
deallocationFunctions
| allocators.cpp:11:6:11:20 | operator delete | getFreedArg = 0 |
| allocators.cpp:12:6:12:22 | operator delete[] | getFreedArg = 0 |