Skip to content

Commit 479ed94

Browse files
committed
Merge branch 'hotfix/0.6.10.5'
2 parents dcceb8a + da94d4b commit 479ed94

File tree

7 files changed

+37
-9
lines changed

7 files changed

+37
-9
lines changed

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
nuitka (0.6.10.5+ds-1) unstable; urgency=medium
2+
3+
* New upstream hotfix release.
4+
5+
-- Kay Hayen <kay.hayen@gmail.com> Thu, 07 Jan 2021 11:04:59 +0100
6+
17
nuitka (0.6.10.4+ds-1) unstable; urgency=medium
28

39
* New upstream hotfix release.

nuitka/Version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"""
2121

2222
version_string = """\
23-
Nuitka V0.6.10.4
23+
Nuitka V0.6.10.5
2424
Copyright (C) 2020 Kay Hayen."""
2525

2626

nuitka/codegen/Contexts.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ def __init__(self):
591591
# Currently active frame stack inside the context.
592592
self.frame_stack = [None]
593593

594-
self.locals_dict_names = set()
594+
self.locals_dict_names = None
595595

596596
def getFrameHandle(self):
597597
return self.frame_stack[-1]
@@ -689,7 +689,7 @@ def getFrameVariableCodeNames(self):
689689
return result
690690

691691
def getLocalsDictNames(self):
692-
return self.locals_dict_names
692+
return self.locals_dict_names or ()
693693

694694
def addLocalsDictName(self, locals_dict_name):
695695
result = self.variable_storage.getVariableDeclarationTop(locals_dict_name)
@@ -699,6 +699,9 @@ def addLocalsDictName(self, locals_dict_name):
699699
"PyObject *", locals_dict_name, "NULL"
700700
)
701701

702+
if self.locals_dict_names is None:
703+
self.locals_dict_names = set()
704+
702705
self.locals_dict_names.add(result)
703706

704707
return result

nuitka/codegen/FunctionCodes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,9 @@ def setupFunctionLocalVariables(
567567
def finalizeFunctionLocalVariables(context):
568568
function_cleanup = []
569569

570-
# TODO: Many times this will not be necessary.
571-
for locals_declaration in context.getLocalsDictNames():
570+
# TODO: Many times it will not be necessary to release locals dict, because
571+
# they already were, but our tracing doesn't yet allow us to know.
572+
for locals_declaration in sorted(context.getLocalsDictNames(), key=str):
572573
function_cleanup.append(
573574
"Py_XDECREF(%(locals_dict)s);\n" % {"locals_dict": locals_declaration}
574575
)

nuitka/codegen/IdCodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def generateBuiltinHashCode(to_name, expression, emit, context):
4141
to_name=to_name,
4242
capi="BUILTIN_HASH",
4343
arg_desc=(("hash_arg", expression.getValue()),),
44-
may_raise=expression.mayRaiseException(BaseException),
44+
may_raise=expression.mayRaiseExceptionOperation(),
4545
conversion_check=decideConversionCheckNeeded(to_name, expression),
4646
source_ref=expression.getCompatibleSourceReference(),
4747
emit=emit,

nuitka/nodes/BuiltinHashNodes.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,21 @@ def __init__(self, value, source_ref):
3636
ExpressionChildHavingBase.__init__(self, value=value, source_ref=source_ref)
3737

3838
def computeExpression(self, trace_collection):
39-
value = self.getValue()
39+
value = self.subnode_value
4040

41-
# TODO: Have a computation slot for hashing.
41+
# TODO: Have a computation slot for hashing and specialize for known cases.
4242
if not value.isKnownToBeHashable():
4343
trace_collection.onExceptionRaiseExit(BaseException)
4444

45+
# TODO: Static raise if it's known not to be hashable.
46+
4547
return self, None, None
4648

4749
def mayRaiseException(self, exception_type):
48-
return not self.getValue().isKnownToBeHashable()
50+
return (
51+
self.subnode_value.mayRaiseException(exception_type)
52+
or not self.subnode_value.isKnownToBeHashable()
53+
)
54+
55+
def mayRaiseExceptionOperation(self):
56+
return not self.subnode_value.isKnownToBeHashable()

nuitka/nodes/ComparisonNodes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def __init__(self, left, right, source_ref):
4545
self, values={"left": left, "right": right}, source_ref=source_ref
4646
)
4747

48+
@staticmethod
49+
def copyTraceStateFrom(source):
50+
pass
51+
4852
def getOperands(self):
4953
return (self.getLeft(), self.getRight())
5054

@@ -98,6 +102,8 @@ def computeExpressionOperationNot(self, not_node, trace_collection):
98102
source_ref=self.source_ref,
99103
)
100104

105+
result.copyTraceStateFrom(self)
106+
101107
return (
102108
result,
103109
"new_expression",
@@ -123,6 +129,10 @@ def getTypeShape(self):
123129
def getDetails(self):
124130
return {}
125131

132+
def copyTraceStateFrom(self, source):
133+
self.type_shape = source.type_shape
134+
self.escape_desc = source.escape_desc
135+
126136
def canCreateUnsupportedException(self):
127137
return hasattr(self.subnode_left.getTypeShape(), "typical_value") and hasattr(
128138
self.subnode_right.getTypeShape(), "typical_value"

0 commit comments

Comments
 (0)