There was an error while loading. Please reload this page.
1 parent c821f88 commit 377117fCopy full SHA for 377117f
1 file changed
echion/stack_chunk.h
@@ -56,7 +56,7 @@ void StackChunk::update(_PyStackChunk* chunk_addr)
56
57
origin = chunk_addr;
58
// if data_size is not enough, reallocate
59
- if (chunk.size > data_capacity)
+ if (chunk.size > data_capacity || data.get() == nullptr)
60
{
61
data_capacity = chunk.size;
62
char* new_data = (char*)realloc(data.get(), data_capacity);
@@ -92,6 +92,11 @@ void* StackChunk::resolve(void* address)
92
93
_PyStackChunk* chunk = (_PyStackChunk*)data.get();
94
95
+ if (chunk == nullptr)
96
+ {
97
+ return address;
98
+ }
99
+
100
// Check if this chunk contains the address
101
if (address >= origin && address < (char*)origin + chunk->size)
102
return (char*)chunk + ((char*)address - (char*)origin);
0 commit comments