From df78af58a87865b8667bad3c5eedc669aa936554 Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Sun, 5 Feb 2023 18:15:18 +0100 Subject: [PATCH] Revert "Use dynamic_cast for Squirrel wrapper instead of reinterpret_cast" This reverts commit 4dda8ecb4384a02bd6c5e51b902bdbe746a774f5. --- tools/miniswig/create_wrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/miniswig/create_wrapper.cpp b/tools/miniswig/create_wrapper.cpp index 25cbab530d9..2e1b90b066c 100644 --- a/tools/miniswig/create_wrapper.cpp +++ b/tools/miniswig/create_wrapper.cpp @@ -299,7 +299,7 @@ WrapperCreator::create_function_wrapper(Class* _class, Function* function) out << ind << ind << "sq_throwerror(vm, _SC(\"'" << function->name << "' called without instance\"));\n"; out << ind << ind << "return SQ_ERROR;\n"; out << ind << "}\n"; - out << ind << "auto _this = dynamic_cast<" << ns_prefix << _class->name << "*> (data);\n"; + out << ind << "auto _this = reinterpret_cast<" << ns_prefix << _class->name << "*> (data);\n"; out << "\n"; out << ind << "if (_this == nullptr) {\n"; out << ind << ind << "return SQ_ERROR;\n";