Nuitka-winsvc 2.2.3__cp311-cp311-win_amd64.whl → 2.3__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.dist-info}/RECORD +198 -197
- nuitka/Bytecodes.py +4 -2
- nuitka/HardImportRegistry.py +1 -0
- nuitka/MainControl.py +16 -10
- nuitka/ModuleRegistry.py +15 -0
- nuitka/OptionParsing.py +30 -8
- nuitka/Options.py +104 -44
- nuitka/PostProcessing.py +9 -8
- nuitka/PythonVersions.py +2 -1
- nuitka/Serialization.py +47 -30
- nuitka/Version.py +1 -1
- nuitka/build/Backend.scons +46 -19
- nuitka/build/CCompilerVersion.scons +3 -3
- nuitka/build/Onefile.scons +4 -4
- nuitka/build/SconsCaching.py +3 -2
- nuitka/build/SconsCompilerSettings.py +11 -5
- nuitka/build/SconsInterface.py +22 -6
- nuitka/build/SconsUtils.py +9 -1
- nuitka/build/include/nuitka/allocator.h +58 -2
- nuitka/build/include/nuitka/compiled_frame.h +48 -13
- nuitka/build/include/nuitka/compiled_function.h +4 -0
- nuitka/build/include/nuitka/constants.h +6 -0
- nuitka/build/include/nuitka/exception_groups.h +6 -6
- nuitka/build/include/nuitka/exceptions.h +3 -3
- nuitka/build/include/nuitka/freelists.h +11 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +5 -4
- nuitka/build/include/nuitka/helper/lists.h +5 -5
- nuitka/build/include/nuitka/helper/lists_generated.h +12 -12
- nuitka/build/include/nuitka/helper/sequences.h +6 -0
- nuitka/build/include/nuitka/helper/slices.h +14 -8
- nuitka/build/include/nuitka/helper/subscripts.h +1 -184
- nuitka/build/include/nuitka/helper/tuples.h +42 -33
- nuitka/build/include/nuitka/importing.h +5 -0
- nuitka/build/include/nuitka/prelude.h +35 -2
- nuitka/build/include/nuitka/safe_string_ops.h +1 -0
- nuitka/build/include/nuitka/threading.h +13 -10
- nuitka/build/static_src/CompiledAsyncgenType.c +19 -8
- nuitka/build/static_src/CompiledCellType.c +1 -1
- nuitka/build/static_src/CompiledCodeHelpers.c +18 -16
- nuitka/build/static_src/CompiledCoroutineType.c +23 -19
- nuitka/build/static_src/CompiledFrameType.c +46 -34
- nuitka/build/static_src/CompiledFunctionType.c +55 -34
- nuitka/build/static_src/CompiledGeneratorType.c +21 -19
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +127 -130
- nuitka/build/static_src/CompiledMethodType.c +15 -17
- nuitka/build/static_src/HelpersAllocator.c +71 -0
- nuitka/build/static_src/HelpersAttributes.c +1 -1
- nuitka/build/static_src/HelpersBuiltin.c +5 -5
- nuitka/build/static_src/HelpersBytes.c +2 -2
- nuitka/build/static_src/HelpersCalling.c +3 -0
- nuitka/build/static_src/HelpersCallingGenerated.c +131 -131
- nuitka/build/static_src/HelpersComparisonEq.c +329 -329
- nuitka/build/static_src/HelpersComparisonEqUtils.c +3 -1
- nuitka/build/static_src/HelpersComparisonGe.c +322 -322
- nuitka/build/static_src/HelpersComparisonGt.c +321 -321
- nuitka/build/static_src/HelpersComparisonLe.c +322 -322
- nuitka/build/static_src/HelpersComparisonLt.c +321 -321
- nuitka/build/static_src/HelpersComparisonNe.c +329 -329
- nuitka/build/static_src/HelpersConsole.c +96 -0
- nuitka/build/static_src/HelpersConstantsBlob.c +10 -6
- nuitka/build/static_src/HelpersDeepcopy.c +10 -8
- nuitka/build/static_src/HelpersDictionaries.c +17 -11
- nuitka/build/static_src/HelpersDictionariesGenerated.c +65 -29
- nuitka/build/static_src/HelpersExceptions.c +107 -9
- nuitka/build/static_src/HelpersFilesystemPaths.c +64 -4
- nuitka/build/static_src/HelpersFloats.c +20 -14
- nuitka/build/static_src/HelpersImport.c +1 -1
- nuitka/build/static_src/HelpersJitSources.c +1 -1
- nuitka/build/static_src/HelpersLists.c +29 -19
- nuitka/build/static_src/HelpersListsGenerated.c +24 -24
- nuitka/build/static_src/HelpersMatching.c +32 -5
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +90 -63
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +4 -4
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +33 -33
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +33 -33
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +33 -33
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +30 -30
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +7 -7
- nuitka/build/static_src/HelpersOperationBinaryMod.c +90 -90
- nuitka/build/static_src/HelpersOperationBinaryMult.c +64 -58
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryPow.c +27 -27
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +30 -30
- nuitka/build/static_src/HelpersOperationBinarySub.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +24 -24
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +67 -49
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +25 -25
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +25 -25
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +25 -25
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +18 -18
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
- nuitka/build/static_src/HelpersOperationInplaceMod.c +70 -70
- nuitka/build/static_src/HelpersOperationInplaceMult.c +33 -33
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +28 -28
- nuitka/build/static_src/HelpersOperationInplacePow.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +18 -18
- nuitka/build/static_src/HelpersOperationInplaceSub.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +28 -28
- nuitka/build/static_src/HelpersRaising.c +10 -3
- nuitka/build/static_src/HelpersSafeStrings.c +14 -4
- nuitka/build/static_src/HelpersSlices.c +12 -5
- nuitka/build/static_src/HelpersStrings.c +1 -1
- nuitka/build/static_src/HelpersTuples.c +20 -15
- nuitka/build/static_src/InspectPatcher.c +74 -6
- nuitka/build/static_src/MainProgram.c +90 -25
- nuitka/build/static_src/MetaPathBasedLoader.c +81 -45
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +2 -2
- nuitka/build/static_src/OnefileBootstrap.c +16 -17
- nuitka/code_generation/CodeGeneration.py +5 -2
- nuitka/code_generation/ConstantCodes.py +2 -2
- nuitka/code_generation/DictCodes.py +2 -2
- nuitka/code_generation/GlobalConstants.py +5 -0
- nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
- nuitka/code_generation/ListCodes.py +2 -2
- nuitka/code_generation/LocalsDictCodes.py +1 -1
- nuitka/code_generation/ModuleCodes.py +19 -0
- nuitka/code_generation/PackageResourceCodes.py +14 -0
- nuitka/code_generation/SliceCodes.py +3 -3
- nuitka/code_generation/SubscriptCodes.py +5 -13
- nuitka/code_generation/TupleCodes.py +1 -1
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +7 -7
- nuitka/code_generation/templates/CodeTemplatesConstants.py +7 -5
- nuitka/code_generation/templates/CodeTemplatesLoader.py +2 -0
- nuitka/code_generation/templates/CodeTemplatesModules.py +78 -54
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +1 -1
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +8 -8
- nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +5 -5
- nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +2 -2
- nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +2 -2
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +57 -21
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +5 -5
- nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +18 -18
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +11 -11
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +11 -11
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +10 -10
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +4 -1
- nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +4 -1
- nuitka/finalizations/FinalizeMarkups.py +0 -18
- nuitka/freezer/DependsExe.py +9 -4
- nuitka/freezer/DllDependenciesMacOS.py +1 -1
- nuitka/freezer/DllDependenciesWin32.py +1 -1
- nuitka/freezer/ImportDetection.py +1 -0
- nuitka/freezer/IncludedDataFiles.py +13 -4
- nuitka/freezer/Onefile.py +0 -1
- nuitka/freezer/Standalone.py +3 -1
- nuitka/importing/ImportCache.py +3 -2
- nuitka/importing/Importing.py +16 -3
- nuitka/importing/StandardLibrary.py +4 -0
- nuitka/nodes/ChildrenHavingMixins.py +2 -0
- nuitka/nodes/ExpressionBasesGenerated.py +4 -0
- nuitka/nodes/HardImportNodesGenerated.py +83 -0
- nuitka/nodes/ModuleNodes.py +10 -2
- nuitka/nodes/OsSysNodes.py +16 -0
- nuitka/nodes/SubscriptNodes.py +3 -3
- nuitka/plugins/PluginBase.py +2 -0
- nuitka/plugins/standard/DataFilesPlugin.py +22 -1
- nuitka/plugins/standard/DillPlugin/DillPlugin.c +3 -3
- nuitka/plugins/standard/OptionsNannyPlugin.py +9 -41
- nuitka/plugins/standard/PkgResourcesPlugin.py +8 -2
- nuitka/plugins/standard/PySidePyQtPlugin.py +3 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +18 -12
- nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +2 -2
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +2 -2
- nuitka/specs/HardImportSpecs.py +3 -0
- nuitka/specs/ParameterSpecs.py +26 -15
- nuitka/tools/general/find_module/FindModuleCode.py +3 -2
- nuitka/tools/specialize/CTypeDescriptions.py +11 -9
- nuitka/tools/testing/Common.py +12 -5
- nuitka/tools/testing/SearchModes.py +5 -1
- nuitka/tools/watch/GitHub.py +1 -7
- nuitka/tree/Building.py +9 -6
- nuitka/tree/ReformulationMatchStatements.py +39 -3
- nuitka/tree/TreeHelpers.py +8 -0
- nuitka/utils/CStrings.py +7 -0
- nuitka/utils/Execution.py +10 -1
- nuitka/utils/FileOperations.py +21 -13
- nuitka/utils/Importing.py +24 -0
- nuitka/utils/ReExecute.py +7 -3
- nuitka/utils/SharedLibraries.py +17 -0
- nuitka/utils/Yaml.py +9 -1
- {Nuitka_winsvc-2.2.3.data → Nuitka_winsvc-2.3.data}/scripts/nuitka-run.bat +0 -0
- {Nuitka_winsvc-2.2.3.data → Nuitka_winsvc-2.3.data}/scripts/nuitka.bat +0 -0
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.dist-info}/WHEEL +0 -0
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.dist-info}/top_level.txt +0 -0
|
@@ -37,7 +37,7 @@ static PyMemberDef Nuitka_Frame_memberlist[] = {
|
|
|
37
37
|
#if PYTHON_VERSION < 0x300
|
|
38
38
|
|
|
39
39
|
static PyObject *Nuitka_Frame_get_exc_traceback(struct Nuitka_FrameObject *frame) {
|
|
40
|
-
assert(
|
|
40
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
41
41
|
CHECK_OBJECT((PyObject *)frame);
|
|
42
42
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
43
43
|
|
|
@@ -52,7 +52,7 @@ static PyObject *Nuitka_Frame_get_exc_traceback(struct Nuitka_FrameObject *frame
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
static int Nuitka_Frame_set_exc_traceback(struct Nuitka_FrameObject *frame, PyObject *traceback) {
|
|
55
|
-
assert(
|
|
55
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
56
56
|
CHECK_OBJECT((PyObject *)frame);
|
|
57
57
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
58
58
|
|
|
@@ -69,7 +69,7 @@ static int Nuitka_Frame_set_exc_traceback(struct Nuitka_FrameObject *frame, PyOb
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
static PyObject *Nuitka_Frame_get_exc_type(struct Nuitka_FrameObject *frame) {
|
|
72
|
-
assert(
|
|
72
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
73
73
|
CHECK_OBJECT((PyObject *)frame);
|
|
74
74
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
75
75
|
|
|
@@ -86,7 +86,7 @@ static PyObject *Nuitka_Frame_get_exc_type(struct Nuitka_FrameObject *frame) {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
static int Nuitka_Frame_set_exc_type(struct Nuitka_FrameObject *frame, PyObject *exception_type) {
|
|
89
|
-
assert(
|
|
89
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
90
90
|
CHECK_OBJECT((PyObject *)frame);
|
|
91
91
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
92
92
|
|
|
@@ -105,7 +105,7 @@ static int Nuitka_Frame_set_exc_type(struct Nuitka_FrameObject *frame, PyObject
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
static PyObject *Nuitka_Frame_get_exc_value(struct Nuitka_FrameObject *frame) {
|
|
108
|
-
assert(
|
|
108
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
109
109
|
CHECK_OBJECT((PyObject *)frame);
|
|
110
110
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
111
111
|
|
|
@@ -122,7 +122,7 @@ static PyObject *Nuitka_Frame_get_exc_value(struct Nuitka_FrameObject *frame) {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
static int Nuitka_Frame_set_exc_value(struct Nuitka_FrameObject *frame, PyObject *exception_value) {
|
|
125
|
-
assert(
|
|
125
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
126
126
|
CHECK_OBJECT((PyObject *)frame);
|
|
127
127
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
128
128
|
|
|
@@ -140,21 +140,23 @@ static int Nuitka_Frame_set_exc_value(struct Nuitka_FrameObject *frame, PyObject
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
static PyObject *Nuitka_Frame_get_restricted(struct Nuitka_FrameObject *frame, void *closure) {
|
|
143
|
-
assert(
|
|
143
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
144
144
|
CHECK_OBJECT((PyObject *)frame);
|
|
145
145
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
Py_INCREF_IMMORTAL(Py_False);
|
|
148
148
|
return Py_False;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
#endif
|
|
152
152
|
|
|
153
153
|
static PyObject *Nuitka_Frame_getlocals(struct Nuitka_FrameObject *nuitka_frame, void *closure) {
|
|
154
|
-
assert(
|
|
154
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)nuitka_frame));
|
|
155
155
|
CHECK_OBJECT((PyObject *)nuitka_frame);
|
|
156
156
|
assert(_PyObject_GC_IS_TRACKED(nuitka_frame));
|
|
157
157
|
|
|
158
|
+
NUITKA_MAY_BE_UNUSED PyThreadState *tstate = PyThreadState_GET();
|
|
159
|
+
|
|
158
160
|
if (nuitka_frame->m_type_description == NULL) {
|
|
159
161
|
#if PYTHON_VERSION < 0x3b0
|
|
160
162
|
PyFrameObject *locals_owner = &nuitka_frame->m_frame;
|
|
@@ -163,13 +165,13 @@ static PyObject *Nuitka_Frame_getlocals(struct Nuitka_FrameObject *nuitka_frame,
|
|
|
163
165
|
#endif
|
|
164
166
|
|
|
165
167
|
if (locals_owner->f_locals == NULL) {
|
|
166
|
-
locals_owner->f_locals = MAKE_DICT_EMPTY();
|
|
168
|
+
locals_owner->f_locals = MAKE_DICT_EMPTY(tstate);
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
Py_INCREF(locals_owner->f_locals);
|
|
170
172
|
return locals_owner->f_locals;
|
|
171
173
|
} else {
|
|
172
|
-
PyObject *result = MAKE_DICT_EMPTY();
|
|
174
|
+
PyObject *result = MAKE_DICT_EMPTY(tstate);
|
|
173
175
|
PyObject **var_names = Nuitka_GetCodeVarNames(Nuitka_GetFrameCodeObject(nuitka_frame));
|
|
174
176
|
|
|
175
177
|
char const *w = nuitka_frame->m_type_description;
|
|
@@ -236,7 +238,7 @@ static PyObject *Nuitka_Frame_getlocals(struct Nuitka_FrameObject *nuitka_frame,
|
|
|
236
238
|
}
|
|
237
239
|
|
|
238
240
|
static PyObject *Nuitka_Frame_getlineno(struct Nuitka_FrameObject *frame, void *closure) {
|
|
239
|
-
assert(
|
|
241
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
240
242
|
CHECK_OBJECT((PyObject *)frame);
|
|
241
243
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
242
244
|
|
|
@@ -244,7 +246,7 @@ static PyObject *Nuitka_Frame_getlineno(struct Nuitka_FrameObject *frame, void *
|
|
|
244
246
|
}
|
|
245
247
|
|
|
246
248
|
static PyObject *Nuitka_Frame_gettrace(struct Nuitka_FrameObject *frame, void *closure) {
|
|
247
|
-
assert(
|
|
249
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
248
250
|
CHECK_OBJECT((PyObject *)frame);
|
|
249
251
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
250
252
|
|
|
@@ -254,7 +256,7 @@ static PyObject *Nuitka_Frame_gettrace(struct Nuitka_FrameObject *frame, void *c
|
|
|
254
256
|
}
|
|
255
257
|
|
|
256
258
|
static int Nuitka_Frame_settrace(struct Nuitka_FrameObject *frame, PyObject *v, void *closure) {
|
|
257
|
-
assert(
|
|
259
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
258
260
|
CHECK_OBJECT((PyObject *)frame);
|
|
259
261
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
260
262
|
|
|
@@ -266,17 +268,17 @@ static int Nuitka_Frame_settrace(struct Nuitka_FrameObject *frame, PyObject *v,
|
|
|
266
268
|
|
|
267
269
|
#if PYTHON_VERSION >= 0x370
|
|
268
270
|
static PyObject *Nuitka_Frame_gettracelines(struct Nuitka_FrameObject *frame, void *closure) {
|
|
269
|
-
assert(
|
|
271
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
270
272
|
CHECK_OBJECT((PyObject *)frame);
|
|
271
273
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
272
274
|
|
|
273
275
|
PyObject *result = Py_False;
|
|
274
|
-
|
|
276
|
+
Py_INCREF_IMMORTAL(result);
|
|
275
277
|
return result;
|
|
276
278
|
}
|
|
277
279
|
|
|
278
280
|
static int Nuitka_Frame_settracelines(struct Nuitka_FrameObject *frame, PyObject *v, void *closure) {
|
|
279
|
-
assert(
|
|
281
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
280
282
|
CHECK_OBJECT((PyObject *)frame);
|
|
281
283
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
282
284
|
|
|
@@ -287,17 +289,17 @@ static int Nuitka_Frame_settracelines(struct Nuitka_FrameObject *frame, PyObject
|
|
|
287
289
|
}
|
|
288
290
|
|
|
289
291
|
static PyObject *Nuitka_Frame_gettraceopcodes(struct Nuitka_FrameObject *frame, void *closure) {
|
|
290
|
-
assert(
|
|
292
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
291
293
|
CHECK_OBJECT((PyObject *)frame);
|
|
292
294
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
293
295
|
|
|
294
296
|
PyObject *result = Py_False;
|
|
295
|
-
|
|
297
|
+
Py_INCREF_IMMORTAL(result);
|
|
296
298
|
return result;
|
|
297
299
|
}
|
|
298
300
|
|
|
299
301
|
static int Nuitka_Frame_settraceopcodes(struct Nuitka_FrameObject *frame, PyObject *v, void *closure) {
|
|
300
|
-
assert(
|
|
302
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
301
303
|
CHECK_OBJECT((PyObject *)frame);
|
|
302
304
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
303
305
|
|
|
@@ -310,7 +312,7 @@ static int Nuitka_Frame_settraceopcodes(struct Nuitka_FrameObject *frame, PyObje
|
|
|
310
312
|
|
|
311
313
|
#if PYTHON_VERSION >= 0x3b0
|
|
312
314
|
static PyObject *Nuitka_Frame_getback(struct Nuitka_FrameObject *frame, void *closure) {
|
|
313
|
-
assert(
|
|
315
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
314
316
|
CHECK_OBJECT((PyObject *)frame);
|
|
315
317
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
316
318
|
|
|
@@ -339,7 +341,7 @@ static PyGetSetDef Nuitka_Frame_getsetlist[] = {
|
|
|
339
341
|
|
|
340
342
|
// tp_repr slot, decide how a function shall be output
|
|
341
343
|
static PyObject *Nuitka_Frame_tp_repr(struct Nuitka_FrameObject *nuitka_frame) {
|
|
342
|
-
assert(
|
|
344
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)nuitka_frame));
|
|
343
345
|
CHECK_OBJECT((PyObject *)nuitka_frame);
|
|
344
346
|
assert(_PyObject_GC_IS_TRACKED(nuitka_frame));
|
|
345
347
|
|
|
@@ -433,6 +435,7 @@ static void Nuitka_Frame_tp_dealloc(struct Nuitka_FrameObject *nuitka_frame) {
|
|
|
433
435
|
_PyInterpreterFrame *locals_owner = &nuitka_frame->m_interpreter_frame;
|
|
434
436
|
#endif
|
|
435
437
|
|
|
438
|
+
assert(Nuitka_GC_IS_TRACKED_X((PyObject *)frame->f_back));
|
|
436
439
|
Py_XDECREF(frame->f_back);
|
|
437
440
|
Py_DECREF(locals_owner->f_builtins);
|
|
438
441
|
Py_DECREF(locals_owner->f_globals);
|
|
@@ -471,7 +474,7 @@ static void Nuitka_Frame_tp_dealloc(struct Nuitka_FrameObject *nuitka_frame) {
|
|
|
471
474
|
}
|
|
472
475
|
|
|
473
476
|
static int Nuitka_Frame_tp_traverse(struct Nuitka_FrameObject *frame, visitproc visit, void *arg) {
|
|
474
|
-
assert(
|
|
477
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
475
478
|
CHECK_OBJECT((PyObject *)frame);
|
|
476
479
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
477
480
|
|
|
@@ -541,7 +544,7 @@ static int Nuitka_Frame_tp_traverse(struct Nuitka_FrameObject *frame, visitproc
|
|
|
541
544
|
#if PYTHON_VERSION >= 0x340
|
|
542
545
|
|
|
543
546
|
static PyObject *Nuitka_Frame_clear(struct Nuitka_FrameObject *frame) {
|
|
544
|
-
assert(
|
|
547
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
545
548
|
CHECK_OBJECT((PyObject *)frame);
|
|
546
549
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
547
550
|
|
|
@@ -623,7 +626,7 @@ static PyObject *Nuitka_Frame_clear(struct Nuitka_FrameObject *frame) {
|
|
|
623
626
|
#endif
|
|
624
627
|
|
|
625
628
|
static inline Py_ssize_t Nuitka_Frame_GetSize(struct Nuitka_FrameObject *frame) {
|
|
626
|
-
assert(
|
|
629
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
627
630
|
CHECK_OBJECT((PyObject *)frame);
|
|
628
631
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
629
632
|
|
|
@@ -635,7 +638,7 @@ static inline Py_ssize_t Nuitka_Frame_GetSize(struct Nuitka_FrameObject *frame)
|
|
|
635
638
|
}
|
|
636
639
|
|
|
637
640
|
static PyObject *Nuitka_Frame_sizeof(struct Nuitka_FrameObject *frame) {
|
|
638
|
-
assert(
|
|
641
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame));
|
|
639
642
|
CHECK_OBJECT((PyObject *)frame);
|
|
640
643
|
assert(_PyObject_GC_IS_TRACKED(frame));
|
|
641
644
|
|
|
@@ -751,7 +754,12 @@ static struct Nuitka_FrameObject *_MAKE_COMPILED_FRAME(PyCodeObject *code, PyObj
|
|
|
751
754
|
_PyInterpreterFrame *locals_owner = &result->m_interpreter_frame;
|
|
752
755
|
#endif
|
|
753
756
|
|
|
757
|
+
#if PYTHON_VERSION < 0x3d0
|
|
754
758
|
locals_owner->f_code = code;
|
|
759
|
+
#else
|
|
760
|
+
// TODO: Why is our code object not just immortal.
|
|
761
|
+
locals_owner->f_executable = (PyObject *)code;
|
|
762
|
+
#endif
|
|
755
763
|
|
|
756
764
|
frame->f_trace = Py_None;
|
|
757
765
|
|
|
@@ -798,9 +806,16 @@ static struct Nuitka_FrameObject *_MAKE_COMPILED_FRAME(PyCodeObject *code, PyObj
|
|
|
798
806
|
|
|
799
807
|
#if PYTHON_VERSION >= 0x3b0
|
|
800
808
|
result->m_interpreter_frame.frame_obj = &result->m_frame;
|
|
801
|
-
result->m_interpreter_frame.owner =
|
|
809
|
+
result->m_interpreter_frame.owner = FRAME_OWNED_BY_GENERATOR;
|
|
810
|
+
#if PYTHON_VERSION >= 0x3c0
|
|
811
|
+
result->m_interpreter_frame.f_funcobj = NULL;
|
|
812
|
+
#else
|
|
813
|
+
result->m_interpreter_frame.f_func = NULL;
|
|
802
814
|
result->m_interpreter_frame.prev_instr = _PyCode_CODE(code);
|
|
815
|
+
#endif
|
|
803
816
|
result->m_frame.f_frame = &result->m_interpreter_frame;
|
|
817
|
+
|
|
818
|
+
assert(!_PyFrame_IsIncomplete(&result->m_interpreter_frame));
|
|
804
819
|
#endif
|
|
805
820
|
|
|
806
821
|
Nuitka_GC_Track(result);
|
|
@@ -980,7 +995,7 @@ PyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *
|
|
|
980
995
|
}
|
|
981
996
|
|
|
982
997
|
void Nuitka_Frame_AttachLocals(struct Nuitka_FrameObject *frame_object, char const *type_description, ...) {
|
|
983
|
-
assert(
|
|
998
|
+
assert(Nuitka_Frame_CheckExact((PyObject *)frame_object));
|
|
984
999
|
CHECK_OBJECT((PyObject *)frame_object);
|
|
985
1000
|
assert(_PyObject_GC_IS_TRACKED(frame_object));
|
|
986
1001
|
assertFrameObject(frame_object);
|
|
@@ -1078,9 +1093,6 @@ void Nuitka_Frame_AttachLocals(struct Nuitka_FrameObject *frame_object, char con
|
|
|
1078
1093
|
void dumpFrameStack(void) {
|
|
1079
1094
|
PyThreadState *tstate = PyThreadState_GET();
|
|
1080
1095
|
|
|
1081
|
-
PyObject *saved_exception_type, *saved_exception_value;
|
|
1082
|
-
PyTracebackObject *saved_exception_tb;
|
|
1083
|
-
|
|
1084
1096
|
struct Nuitka_ExceptionPreservationItem saved_exception_state;
|
|
1085
1097
|
FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);
|
|
1086
1098
|
|
|
@@ -1118,7 +1130,7 @@ void dumpFrameStack(void) {
|
|
|
1118
1130
|
current_repr = const_str_empty;
|
|
1119
1131
|
Py_INCREF(const_str_empty);
|
|
1120
1132
|
}
|
|
1121
|
-
PyObject *code_repr = PyObject_Str((PyObject *)current->current_frame
|
|
1133
|
+
PyObject *code_repr = PyObject_Str((PyObject *)Nuitka_InterpreterFrame_GetCodeObject(current->current_frame));
|
|
1122
1134
|
#endif
|
|
1123
1135
|
|
|
1124
1136
|
PRINT_FORMAT("Frame stack %d: %s %d %s\n", total--, Nuitka_String_AsString(current_repr), Py_REFCNT(current),
|
|
@@ -1174,7 +1186,7 @@ void PRINT_INTERPRETER_FRAME(char const *prefix, Nuitka_ThreadStateFrameType *fr
|
|
|
1174
1186
|
if (frame) {
|
|
1175
1187
|
PRINT_FORMAT("0x%lx ", frame);
|
|
1176
1188
|
|
|
1177
|
-
PyObject *code_object_str = PyObject_Repr((PyObject *)frame
|
|
1189
|
+
PyObject *code_object_str = PyObject_Repr((PyObject *)Nuitka_InterpreterFrame_GetCodeObject(frame));
|
|
1178
1190
|
PRINT_ITEM(code_object_str);
|
|
1179
1191
|
Py_DECREF(code_object_str);
|
|
1180
1192
|
} else {
|
|
@@ -1191,7 +1203,7 @@ void PRINT_TOP_FRAME(char const *prefix) {
|
|
|
1191
1203
|
#if PYTHON_VERSION < 0x3b0
|
|
1192
1204
|
PRINT_UNCOMPILED_FRAME(prefix, tstate->frame);
|
|
1193
1205
|
#else
|
|
1194
|
-
PRINT_INTERPRETER_FRAME(prefix, tstate
|
|
1206
|
+
PRINT_INTERPRETER_FRAME(prefix, CURRENT_TSTATE_INTERPRETER_FRAME(tstate));
|
|
1195
1207
|
#endif
|
|
1196
1208
|
}
|
|
1197
1209
|
|
|
@@ -45,13 +45,11 @@ static PyObject *Nuitka_Function_tp_repr(struct Nuitka_FunctionObject *function)
|
|
|
45
45
|
assert(Nuitka_Function_Check((PyObject *)function));
|
|
46
46
|
assert(_PyObject_GC_IS_TRACKED(function));
|
|
47
47
|
|
|
48
|
-
return Nuitka_String_FromFormat("<compiled_function %s at %p>",
|
|
49
48
|
#if PYTHON_VERSION < 0x300
|
|
50
|
-
|
|
49
|
+
return Nuitka_String_FromFormat("<compiled_function %s at %p>", Nuitka_String_AsString(function->m_name), function);
|
|
51
50
|
#else
|
|
52
|
-
|
|
51
|
+
return Nuitka_String_FromFormat("<compiled_function %U at %p>", function->m_qualname, function);
|
|
53
52
|
#endif
|
|
54
|
-
function);
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
static long Nuitka_Function_tp_traverse(struct Nuitka_FunctionObject *function, visitproc visit, void *arg) {
|
|
@@ -192,7 +190,9 @@ static PyObject *Nuitka_Function_get_dict(struct Nuitka_FunctionObject *function
|
|
|
192
190
|
assert(_PyObject_GC_IS_TRACKED(function));
|
|
193
191
|
|
|
194
192
|
if (function->m_dict == NULL) {
|
|
195
|
-
|
|
193
|
+
NUITKA_MAY_BE_UNUSED PyThreadState *tstate = PyThreadState_GET();
|
|
194
|
+
|
|
195
|
+
function->m_dict = MAKE_DICT_EMPTY(tstate);
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
CHECK_OBJECT(function->m_dict);
|
|
@@ -309,9 +309,10 @@ static PyObject *Nuitka_Function_get_closure(struct Nuitka_FunctionObject *funct
|
|
|
309
309
|
assert(_PyObject_GC_IS_TRACKED(function));
|
|
310
310
|
|
|
311
311
|
if (function->m_closure_given > 0) {
|
|
312
|
-
|
|
312
|
+
NUITKA_MAY_BE_UNUSED PyThreadState *tstate = PyThreadState_GET();
|
|
313
|
+
return MAKE_TUPLE(tstate, (PyObject *const *)function->m_closure, function->m_closure_given);
|
|
313
314
|
} else {
|
|
314
|
-
|
|
315
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
315
316
|
return Py_None;
|
|
316
317
|
}
|
|
317
318
|
}
|
|
@@ -440,7 +441,9 @@ static PyObject *Nuitka_Function_get_annotations(struct Nuitka_FunctionObject *f
|
|
|
440
441
|
assert(_PyObject_GC_IS_TRACKED(function));
|
|
441
442
|
|
|
442
443
|
if (function->m_annotations == NULL) {
|
|
443
|
-
|
|
444
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
445
|
+
|
|
446
|
+
function->m_annotations = MAKE_DICT_EMPTY(tstate);
|
|
444
447
|
}
|
|
445
448
|
CHECK_OBJECT(function->m_annotations);
|
|
446
449
|
|
|
@@ -520,13 +523,19 @@ static PyObject *Nuitka_Function_get_builtins(struct Nuitka_FunctionObject *func
|
|
|
520
523
|
#if PYTHON_VERSION >= 0x3c0
|
|
521
524
|
static int Nuitka_Function_set_type_params(struct Nuitka_FunctionObject *function, PyObject *value) {
|
|
522
525
|
CHECK_OBJECT((PyObject *)function);
|
|
526
|
+
CHECK_OBJECT_X(value);
|
|
523
527
|
assert(Nuitka_Function_Check((PyObject *)function));
|
|
524
528
|
assert(_PyObject_GC_IS_TRACKED(function));
|
|
525
529
|
|
|
526
|
-
|
|
530
|
+
if (unlikely(value == NULL || !PyTuple_Check(value))) {
|
|
531
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
527
532
|
|
|
528
|
-
|
|
529
|
-
|
|
533
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, "__type_params__ must be set to a tuple");
|
|
534
|
+
return -1;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
Py_SETREF(function->m_type_params, Py_NewRef(value));
|
|
538
|
+
return 0;
|
|
530
539
|
}
|
|
531
540
|
|
|
532
541
|
static PyObject *Nuitka_Function_get_type_params(struct Nuitka_FunctionObject *function) {
|
|
@@ -547,7 +556,9 @@ static int Nuitka_Function_set_module(struct Nuitka_FunctionObject *function, Py
|
|
|
547
556
|
CHECK_OBJECT_X(value);
|
|
548
557
|
|
|
549
558
|
if (function->m_dict == NULL) {
|
|
550
|
-
|
|
559
|
+
NUITKA_MAY_BE_UNUSED PyThreadState *tstate = PyThreadState_GET();
|
|
560
|
+
|
|
561
|
+
function->m_dict = MAKE_DICT_EMPTY(tstate);
|
|
551
562
|
}
|
|
552
563
|
|
|
553
564
|
if (value == NULL) {
|
|
@@ -663,10 +674,12 @@ static PyObject *Nuitka_Function_clone(struct Nuitka_FunctionObject *function) {
|
|
|
663
674
|
PRINT_NEW_LINE();
|
|
664
675
|
#endif
|
|
665
676
|
|
|
677
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
678
|
+
|
|
666
679
|
PyObject *annotations = function->m_annotations;
|
|
667
680
|
if (annotations != NULL) {
|
|
668
681
|
if (DICT_SIZE(annotations) != 0) {
|
|
669
|
-
annotations = DICT_COPY(annotations);
|
|
682
|
+
annotations = DICT_COPY(tstate, annotations);
|
|
670
683
|
} else {
|
|
671
684
|
annotations = NULL;
|
|
672
685
|
}
|
|
@@ -675,7 +688,7 @@ static PyObject *Nuitka_Function_clone(struct Nuitka_FunctionObject *function) {
|
|
|
675
688
|
PyObject *kwdefaults = function->m_kwdefaults;
|
|
676
689
|
if (kwdefaults != NULL) {
|
|
677
690
|
if (DICT_SIZE(kwdefaults) != 0) {
|
|
678
|
-
kwdefaults = DICT_COPY(kwdefaults);
|
|
691
|
+
kwdefaults = DICT_COPY(tstate, kwdefaults);
|
|
679
692
|
} else {
|
|
680
693
|
kwdefaults = NULL;
|
|
681
694
|
}
|
|
@@ -729,6 +742,10 @@ static void Nuitka_Function_tp_dealloc(struct Nuitka_FunctionObject *function) {
|
|
|
729
742
|
Py_DECREF(function->m_qualname);
|
|
730
743
|
#endif
|
|
731
744
|
|
|
745
|
+
#if PYTHON_VERSION >= 0x3c0
|
|
746
|
+
Py_DECREF(function->m_type_params);
|
|
747
|
+
#endif
|
|
748
|
+
|
|
732
749
|
// These may actually resurrect the object, not?
|
|
733
750
|
Py_XDECREF(function->m_dict);
|
|
734
751
|
Py_DECREF(function->m_defaults);
|
|
@@ -1004,7 +1021,7 @@ static PyObject *_Nuitka_FunctionEmptyCodeTrueImpl(PyThreadState *tstate, struct
|
|
|
1004
1021
|
|
|
1005
1022
|
PyObject *result = Py_True;
|
|
1006
1023
|
|
|
1007
|
-
|
|
1024
|
+
Py_INCREF_IMMORTAL(result);
|
|
1008
1025
|
return result;
|
|
1009
1026
|
}
|
|
1010
1027
|
|
|
@@ -1021,8 +1038,7 @@ static PyObject *_Nuitka_FunctionEmptyCodeFalseImpl(PyThreadState *tstate, struc
|
|
|
1021
1038
|
}
|
|
1022
1039
|
|
|
1023
1040
|
PyObject *result = Py_False;
|
|
1024
|
-
|
|
1025
|
-
Py_INCREF(result);
|
|
1041
|
+
Py_INCREF_IMMORTAL(result);
|
|
1026
1042
|
return result;
|
|
1027
1043
|
}
|
|
1028
1044
|
|
|
@@ -1248,7 +1264,7 @@ struct Nuitka_FunctionObject *Nuitka_Function_New(function_impl_code c_code, PyO
|
|
|
1248
1264
|
#endif
|
|
1249
1265
|
|
|
1250
1266
|
if (defaults == NULL) {
|
|
1251
|
-
|
|
1267
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
1252
1268
|
defaults = Py_None;
|
|
1253
1269
|
}
|
|
1254
1270
|
CHECK_OBJECT(defaults);
|
|
@@ -1318,6 +1334,11 @@ struct Nuitka_FunctionObject *Nuitka_Function_New(function_impl_code c_code, PyO
|
|
|
1318
1334
|
result->m_vectorcall = (vectorcallfunc)Nuitka_Function_tp_vectorcall;
|
|
1319
1335
|
#endif
|
|
1320
1336
|
|
|
1337
|
+
#if PYTHON_VERSION >= 0x3c0
|
|
1338
|
+
result->m_type_params = const_tuple_empty;
|
|
1339
|
+
assert(_Py_IsImmortal(result->m_type_params));
|
|
1340
|
+
#endif
|
|
1341
|
+
|
|
1321
1342
|
Nuitka_GC_Track(result);
|
|
1322
1343
|
|
|
1323
1344
|
assert(Py_REFCNT(result) == 1);
|
|
@@ -1885,7 +1906,7 @@ static Py_ssize_t handleKeywordArgsSplit(struct Nuitka_FunctionObject const *fun
|
|
|
1885
1906
|
return kw_found;
|
|
1886
1907
|
}
|
|
1887
1908
|
|
|
1888
|
-
static PyObject *COPY_DICT_KW(PyObject *dict_value);
|
|
1909
|
+
static PyObject *COPY_DICT_KW(PyThreadState *tstate, PyObject *dict_value);
|
|
1889
1910
|
|
|
1890
1911
|
static bool MAKE_STAR_DICT_DICTIONARY_COPY(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,
|
|
1891
1912
|
PyObject **python_pars, PyObject *kw) {
|
|
@@ -1893,9 +1914,9 @@ static bool MAKE_STAR_DICT_DICTIONARY_COPY(PyThreadState *tstate, struct Nuitka_
|
|
|
1893
1914
|
assert(star_dict_index != -1);
|
|
1894
1915
|
|
|
1895
1916
|
if (kw == NULL || ((PyDictObject *)kw)->ma_used == 0) {
|
|
1896
|
-
python_pars[star_dict_index] = MAKE_DICT_EMPTY();
|
|
1917
|
+
python_pars[star_dict_index] = MAKE_DICT_EMPTY(tstate);
|
|
1897
1918
|
} else {
|
|
1898
|
-
python_pars[star_dict_index] = COPY_DICT_KW(kw);
|
|
1919
|
+
python_pars[star_dict_index] = COPY_DICT_KW(tstate, kw);
|
|
1899
1920
|
|
|
1900
1921
|
if (unlikely(python_pars[star_dict_index] == NULL)) {
|
|
1901
1922
|
formatErrorKeywordsMustBeString(tstate, function);
|
|
@@ -2026,30 +2047,30 @@ static Py_ssize_t handleKeywordArgsSplitWithStarDict(PyThreadState *tstate,
|
|
|
2026
2047
|
return kw_found;
|
|
2027
2048
|
}
|
|
2028
2049
|
|
|
2029
|
-
static void makeStarListTupleCopy(struct Nuitka_FunctionObject const *function,
|
|
2030
|
-
PyObject *const *args, Py_ssize_t args_size) {
|
|
2050
|
+
static void makeStarListTupleCopy(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,
|
|
2051
|
+
PyObject **python_pars, PyObject *const *args, Py_ssize_t args_size) {
|
|
2031
2052
|
assert(function->m_args_star_list_index != -1);
|
|
2032
2053
|
Py_ssize_t list_star_index = function->m_args_star_list_index;
|
|
2033
2054
|
|
|
2034
2055
|
// Copy left-over argument values to the star list parameter given.
|
|
2035
2056
|
if (args_size > function->m_args_positional_count) {
|
|
2036
2057
|
python_pars[list_star_index] =
|
|
2037
|
-
MAKE_TUPLE(&args[function->m_args_positional_count], args_size - function->m_args_positional_count);
|
|
2058
|
+
MAKE_TUPLE(tstate, &args[function->m_args_positional_count], args_size - function->m_args_positional_count);
|
|
2038
2059
|
} else {
|
|
2039
2060
|
python_pars[list_star_index] = const_tuple_empty;
|
|
2040
2061
|
Py_INCREF(const_tuple_empty);
|
|
2041
2062
|
}
|
|
2042
2063
|
}
|
|
2043
2064
|
|
|
2044
|
-
static void makeStarListTupleCopyMethod(struct Nuitka_FunctionObject const *function,
|
|
2045
|
-
PyObject *const *args, Py_ssize_t args_size) {
|
|
2065
|
+
static void makeStarListTupleCopyMethod(PyThreadState *tstate, struct Nuitka_FunctionObject const *function,
|
|
2066
|
+
PyObject **python_pars, PyObject *const *args, Py_ssize_t args_size) {
|
|
2046
2067
|
assert(function->m_args_star_list_index != -1);
|
|
2047
2068
|
Py_ssize_t list_star_index = function->m_args_star_list_index;
|
|
2048
2069
|
|
|
2049
2070
|
// Copy left-over argument values to the star list parameter given.
|
|
2050
2071
|
if (args_size + 1 > function->m_args_positional_count) {
|
|
2051
|
-
python_pars[list_star_index] =
|
|
2052
|
-
|
|
2072
|
+
python_pars[list_star_index] = MAKE_TUPLE(tstate, &args[function->m_args_positional_count - 1],
|
|
2073
|
+
args_size + 1 - function->m_args_positional_count);
|
|
2053
2074
|
} else {
|
|
2054
2075
|
python_pars[list_star_index] = const_tuple_empty;
|
|
2055
2076
|
Py_INCREF(const_tuple_empty);
|
|
@@ -2137,7 +2158,7 @@ static bool _handleArgumentsPlainOnly(PyThreadState *tstate, struct Nuitka_Funct
|
|
|
2137
2158
|
#endif
|
|
2138
2159
|
|
|
2139
2160
|
if (function->m_args_star_list_index != -1) {
|
|
2140
|
-
makeStarListTupleCopy(function, python_pars, args, args_size);
|
|
2161
|
+
makeStarListTupleCopy(tstate, function, python_pars, args, args_size);
|
|
2141
2162
|
}
|
|
2142
2163
|
|
|
2143
2164
|
return true;
|
|
@@ -2156,7 +2177,7 @@ static bool handleMethodArgumentsPlainOnly(PyThreadState *tstate, struct Nuitka_
|
|
|
2156
2177
|
// Without self, there can only be star list to get the object as its
|
|
2157
2178
|
// first element. Or we complain about illegal arguments.
|
|
2158
2179
|
if (function->m_args_star_list_index == 0) {
|
|
2159
|
-
python_pars[0] = MAKE_TUPLE_EMPTY(args_size + 1);
|
|
2180
|
+
python_pars[0] = MAKE_TUPLE_EMPTY(tstate, args_size + 1);
|
|
2160
2181
|
PyTuple_SET_ITEM0(python_pars[0], 0, object);
|
|
2161
2182
|
|
|
2162
2183
|
for (Py_ssize_t i = 0; i < args_size; i++) {
|
|
@@ -2241,7 +2262,7 @@ static bool handleMethodArgumentsPlainOnly(PyThreadState *tstate, struct Nuitka_
|
|
|
2241
2262
|
#endif
|
|
2242
2263
|
|
|
2243
2264
|
if (function->m_args_star_list_index != -1) {
|
|
2244
|
-
makeStarListTupleCopyMethod(function, python_pars, args, args_size);
|
|
2265
|
+
makeStarListTupleCopyMethod(tstate, function, python_pars, args, args_size);
|
|
2245
2266
|
}
|
|
2246
2267
|
|
|
2247
2268
|
return true;
|
|
@@ -2371,7 +2392,7 @@ static bool _handleArgumentsPlain(PyThreadState *tstate, struct Nuitka_FunctionO
|
|
|
2371
2392
|
#endif
|
|
2372
2393
|
|
|
2373
2394
|
if (function->m_args_star_list_index != -1) {
|
|
2374
|
-
makeStarListTupleCopy(function, python_pars, args, args_size);
|
|
2395
|
+
makeStarListTupleCopy(tstate, function, python_pars, args, args_size);
|
|
2375
2396
|
}
|
|
2376
2397
|
|
|
2377
2398
|
return true;
|
|
@@ -2438,7 +2459,7 @@ static bool parseArgumentsPos(PyThreadState *tstate, struct Nuitka_FunctionObjec
|
|
|
2438
2459
|
#endif
|
|
2439
2460
|
|
|
2440
2461
|
if (function->m_args_star_dict_index != -1) {
|
|
2441
|
-
python_pars[function->m_args_star_dict_index] = MAKE_DICT_EMPTY();
|
|
2462
|
+
python_pars[function->m_args_star_dict_index] = MAKE_DICT_EMPTY(tstate);
|
|
2442
2463
|
}
|
|
2443
2464
|
|
|
2444
2465
|
return true;
|
|
@@ -2490,7 +2511,7 @@ static bool parseArgumentsMethodPos(PyThreadState *tstate, struct Nuitka_Functio
|
|
|
2490
2511
|
#endif
|
|
2491
2512
|
|
|
2492
2513
|
if (function->m_args_star_dict_index != -1) {
|
|
2493
|
-
python_pars[function->m_args_star_dict_index] = MAKE_DICT_EMPTY();
|
|
2514
|
+
python_pars[function->m_args_star_dict_index] = MAKE_DICT_EMPTY(tstate);
|
|
2494
2515
|
}
|
|
2495
2516
|
|
|
2496
2517
|
return true;
|