summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-05-24 15:08:14 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-05-24 15:52:17 -0300
commitcbd2e80d0351fa19ee1ad67f9516fa0e975fc561 (patch)
tree540fb423ee9491b14cd9fe607bf15cd92e02be3d
parentb8b2278c78a42962c0158cda2c0427c27e3be09b (diff)
downloadshiboken-cbd2e80d0351fa19ee1ad67f9516fa0e975fc561.tar.gz
shiboken-cbd2e80d0351fa19ee1ad67f9516fa0e975fc561.tar.xz
shiboken-cbd2e80d0351fa19ee1ad67f9516fa0e975fc561.zip
Fix segfault in function return modification.
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>, Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--cppgenerator.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp
index c6e4d89b..33456f7f 100644
--- a/cppgenerator.cpp
+++ b/cppgenerator.cpp
@@ -1380,8 +1380,12 @@ QString CppGenerator::argumentNameFromIndex(const AbstractMetaFunction* func, in
pyArgName = QString("self");
*wrappedClass = func->implementingClass();
} else if (argIndex == 0) {
- pyArgName = PYTHON_RETURN_VAR;
- *wrappedClass = classes().findClass(func->type()->typeEntry()->name());
+ if (func->type()) {
+ pyArgName = PYTHON_RETURN_VAR;
+ *wrappedClass = classes().findClass(func->type()->typeEntry()->name());
+ } else {
+ ReportHandler::warning("Invalid Argument index on function modification: " + func->name());
+ }
} else {
int real_index = OverloadData::numberOfRemovedArguments(func, argIndex - 1);
*wrappedClass = classes().findClass(func->arguments().at(real_index)->type()->typeEntry()->name());