easy fix for clearAssembly() crashes
Sometimes code executes while the memory is being cleared. Keeping the old data instead of clearing it creates a fail-safe in case of this happening.
This commit is contained in:
parent
45c4df406f
commit
653e4375e2
@ -26,15 +26,6 @@ void executeAssembly() {
|
||||
}
|
||||
|
||||
void clearAssembly() {
|
||||
log_printf("[Clear assembly] Assembly size: %i\n", assemblySize);
|
||||
unsigned char buffer[assemblySize];
|
||||
log_print("[Clear assembly] Buffer allocated\n");
|
||||
memset((void *) buffer, 0, assemblySize);
|
||||
log_print("[Clear assembly] Memory set\n");
|
||||
int startAddress = getStartAddress();
|
||||
log_printf("[Clear assembly] Start address: %i\n", startAddress);
|
||||
kernelCopyData((unsigned char *) startAddress, buffer, assemblySize);
|
||||
log_print("[Clear assembly] Kernel copy done\n");
|
||||
assemblySize = 0;
|
||||
log_print("[Clear assembly] Assembly size 0\n");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user