mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
Improved handling of virtual inheritance. (#7)
* new system for handling vtables * commented out non-matching JKRDisposer::~JKDisposer() * removed artificial vtables and matched simple virtual-call functions * better text on nonmatching functions * reverted asmdiff.sh * attempt 2 * Spelling * banner and .gitignore for vtable artifacts * move virtual function to the correct class * remove unnecessary casts
This commit is contained in:
@@ -3,20 +3,31 @@
|
||||
#include "JSystem/JKernel/JKRHeap/JKRHeap.h"
|
||||
|
||||
// #include "JSystem/JKernel/asm/func_802D147C.s"
|
||||
JKRDisposer::JKRDisposer() : __vt(&lbl_803CC0F0), ptr_link(this) {
|
||||
this->heap = JKRHeap::findFromRoot(this);
|
||||
JKRDisposer::JKRDisposer() : ptr_link(this) {
|
||||
this->heap = JKRHeap::findFromRoot(this);
|
||||
if (this->heap != 0) {
|
||||
this->heap->disposable_list.append(&this->ptr_link);
|
||||
}
|
||||
}
|
||||
|
||||
// Almost. Missing three instructions, something
|
||||
// to do with the destruction of JSUPtrLink
|
||||
/*
|
||||
Super close.
|
||||
|
||||
This is what we expected: (from Ghidra)
|
||||
if (this != (JKRDisposer *)&DAT_fffffff8) {
|
||||
JSUPtrLink::~JSUPtrLink(&this->ptr_link,0);
|
||||
}
|
||||
|
||||
But the compiler generate code like this instead: (no if and -1 instead of 0)
|
||||
JSUPtrLink::~JSUPtrLink(&this->ptr_link,-1);
|
||||
|
||||
Maybe we are using the wrong compiler?
|
||||
*/
|
||||
#ifdef NONMATCHING
|
||||
JKRDisposer::~JKRDisposer() {
|
||||
this->__vt = lbl_803CC0F0;
|
||||
if (this->heap != NULL) {
|
||||
this->heap->disposable_list.remove(&this->ptr_link);
|
||||
JKRHeap* heap = this->heap;
|
||||
if (heap != 0) {
|
||||
heap->disposable_list.remove(&this->ptr_link);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user