X-Git-Url: https://git.saurik.com/apple/dyld.git/blobdiff_plain/d3f1e533acc7f70659b8bde9b6c040974f05e03b..bc3b7c8cda49ed8598284a489c0bb9694c67c6a4:/testing/kernel-cache-tests/kernel-vtable-patching-large-base-addr/foo.cpp diff --git a/testing/kernel-cache-tests/kernel-vtable-patching-large-base-addr/foo.cpp b/testing/kernel-cache-tests/kernel-vtable-patching-large-base-addr/foo.cpp new file mode 100644 index 0000000..83e5e67 --- /dev/null +++ b/testing/kernel-cache-tests/kernel-vtable-patching-large-base-addr/foo.cpp @@ -0,0 +1,23 @@ + +#include "foo.h" + +OSDefineMetaClassAndStructors( Foo, OSObject ) + +// Index 0 has been replaced with a method +OSMetaClassDefineReservedUsed(Foo, 0) +OSMetaClassDefineReservedUnused( Foo, 1 ) +OSMetaClassDefineReservedUnused( Foo, 2 ) +OSMetaClassDefineReservedUnused( Foo, 3 ) + +int Foo::foo() { + return 0; +} + +int Foo::fooUsed0() { + return 0; +} + +int foo() { + Foo* foo = new Foo(); + return foo->foo() + foo->fooUsed0(); +}