Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
6fb48490
Commit
6fb48490
authored
May 01, 2016
by
Wenzel Jakob
Browse files
fix crash when None is passed to enum::operator==
parent
9059bd81
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+4
-4
No files found.
include/pybind11/pybind11.h
View file @
6fb48490
...
...
@@ -409,7 +409,6 @@ protected:
}
}
}
if
(
kwargs_consumed
==
nkwargs
)
result
=
it
->
impl
(
it
,
args_
,
parent
);
...
...
@@ -937,10 +936,11 @@ public:
((
it
==
entries
->
end
())
?
std
::
string
(
"???"
)
:
std
::
string
(
it
->
second
));
});
this
->
def
(
"__init__"
,
[](
Type
&
value
,
int
i
)
{
value
=
(
Type
)
i
;
});
this
->
def
(
"__init__"
,
[](
Type
&
value
,
int
i
)
{
value
=
(
Type
)
i
;
});
this
->
def
(
"__init__"
,
[](
Type
&
value
,
int
i
)
{
new
(
&
value
)
Type
((
Type
)
i
);
});
this
->
def
(
"__int__"
,
[](
Type
value
)
{
return
(
int
)
value
;
});
this
->
def
(
"__eq__"
,
[](
const
Type
&
value
,
Type
value2
)
{
return
value
==
value2
;
});
this
->
def
(
"__ne__"
,
[](
const
Type
&
value
,
Type
value2
)
{
return
value
!=
value2
;
});
this
->
def
(
"__eq__"
,
[](
const
Type
&
value
,
Type
*
value2
)
{
return
value2
&&
value
==
*
value2
;
});
this
->
def
(
"__ne__"
,
[](
const
Type
&
value
,
Type
*
value2
)
{
return
!
value2
||
value
!=
*
value2
;
});
this
->
def
(
"__hash__"
,
[](
const
Type
&
value
)
{
return
(
int
)
value
;
});
m_entries
=
entries
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment