Skip to content

Commit e32388c

Browse files
committed
interrogate: fix crash reading static property
1 parent 3f91615 commit e32388c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

dtool/src/interrogate/interfaceMakerPythonNative.cxx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6975,7 +6975,11 @@ write_getset(ostream &out, Object *obj, Property *property) {
69756975
out << " if (wrap != nullptr) {\n"
69766976
" wrap->_getitem_func = &Dtool_" << ClassName << "_" << ielem.get_name() << "_Mapping_Getitem;\n";
69776977
if (!property->_setter_remaps.empty()) {
6978-
out << " if (!DtoolInstance_IS_CONST(self)) {\n";
6978+
if (property->_has_this) {
6979+
out << " if (!DtoolInstance_IS_CONST(self)) {\n";
6980+
} else {
6981+
out << " {\n";
6982+
}
69796983
out << " wrap->_setitem_func = &Dtool_" << ClassName << "_" << ielem.get_name() << "_Mapping_Setitem;\n";
69806984
out << " }\n";
69816985
}
@@ -7006,7 +7010,11 @@ write_getset(ostream &out, Object *obj, Property *property) {
70067010
" wrap->_len_func = &Dtool_" << ClassName << "_" << ielem.get_name() << "_Len;\n"
70077011
" wrap->_getitem_func = &Dtool_" << ClassName << "_" << ielem.get_name() << "_Sequence_Getitem;\n";
70087012
if (!property->_setter_remaps.empty()) {
7009-
out << " if (!DtoolInstance_IS_CONST(self)) {\n";
7013+
if (property->_has_this) {
7014+
out << " if (!DtoolInstance_IS_CONST(self)) {\n";
7015+
} else {
7016+
out << " {\n";
7017+
}
70107018
out << " wrap->_setitem_func = &Dtool_" << ClassName << "_" << ielem.get_name() << "_Sequence_Setitem;\n";
70117019
if (property->_inserter != nullptr) {
70127020
out << " wrap->_insert_func = &Dtool_" << ClassName << "_" << ielem.get_name() << "_Sequence_insert;\n";

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy