projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5c59429
)
throw exception when member is NULL
author
Benedikt Tutzer
<e1225461@student.tuwien.ac.at>
Thu, 6 Dec 2018 11:17:09 +0000
(12:17 +0100)
committer
Benedikt Tutzer
<e1225461@student.tuwien.ac.at>
Thu, 6 Dec 2018 11:17:09 +0000
(12:17 +0100)
py_wrap_generator.py
patch
|
blob
|
history
diff --git
a/py_wrap_generator.py
b/py_wrap_generator.py
index 40b4ddc17c09a75b973c409b8ce23567d865a99c..658779ca64bee56eec605251844f3224959a3b7d 100644
(file)
--- a/
py_wrap_generator.py
+++ b/
py_wrap_generator.py
@@
-1676,6
+1676,9
@@
class WMember:
def gen_def(self):
text = "\n\t" + self.wtype.gen_text() + " " + self.member_of.name +"::get_var_py_" + self.name + "()"
text += "\n\t{\n\t\t"
+ if self.wtype.attr_type == attr_types.star:
+ text += "if(this->get_cpp_obj()->" + self.name + " == NULL)\n\t\t\t"
+ text += "throw std::runtime_error(\"Member \\\"" + self.name + "\\\" is NULL\");\n\t\t"
if self.wtype.name in known_containers:
text += self.wtype.gen_text_cpp()
else: