From 3c9591cfbffc0ac9f4ff9885c00bb04569c10fc7 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 7 Oct 2019 21:46:37 +0200 Subject: [PATCH] interrogate: envelop function calls in parentheses This reduces the risk of calling a preprocessor macro instead of a method. --- dtool/src/interrogate/functionRemap.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index d5d6ab643c..fd44f9f5fa 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -445,15 +445,16 @@ get_call_str(const string &container, const vector_string &pexprs) const { } else if (_has_this && !container.empty()) { // If we have a "this" parameter, the calling convention is also a bit // different. - call << "("; + call << "(("; _parameters[0]._remap->pass_parameter(call, container); - call << ")." << _cppfunc->get_local_name(); + call << ")." << _cppfunc->get_local_name() << ")"; } else { + call << "("; if (_cpptype != nullptr) { call << _cpptype->get_local_name(&parser); } - call << "::" << _cppfunc->get_local_name(); + call << "::" << _cppfunc->get_local_name() << ")"; } } call << "(";