|
45 | 45 | #include <cmath> |
46 | 46 | #include <span> |
47 | 47 | #include <type_traits> |
| 48 | +#include <vector> |
48 | 49 |
|
49 | 50 | using namespace cinderx; |
50 | 51 | using namespace cinderx::jit; |
@@ -1610,20 +1611,21 @@ StaticCallReturn failedDeferredCompileShim(PyObject** args) { |
1610 | 1611 | // ... |
1611 | 1612 |
|
1612 | 1613 | PyObject** dest_args; |
1613 | | - auto final_args = std::make_unique<PyObject*[]>(total_args); |
| 1614 | + std::vector<PyObject*> final_args; |
1614 | 1615 | int cc_reg_args = codegen::ARGUMENT_REGS.size(); |
1615 | 1616 |
|
1616 | 1617 | if (total_args < cc_reg_args) { |
1617 | 1618 | // no gap in args to worry about |
1618 | 1619 | dest_args = args + 1; |
1619 | 1620 | } else { |
| 1621 | + final_args.resize(total_args); |
1620 | 1622 | for (int i = 0; i < cc_reg_args - 1; i++) { |
1621 | 1623 | final_args[i] = args[i + 1]; |
1622 | 1624 | } |
1623 | 1625 | for (int i = cc_reg_args - 1; i < total_args; i++) { |
1624 | 1626 | final_args[i] = args[i + 3]; |
1625 | 1627 | } |
1626 | | - dest_args = final_args.get(); |
| 1628 | + dest_args = final_args.data(); |
1627 | 1629 | } |
1628 | 1630 |
|
1629 | 1631 | _PyTypedArgsInfo* arg_info = getContext()->findFunctionPrimitiveArgInfo(func); |
@@ -1678,11 +1680,8 @@ StaticCallReturn failedDeferredCompileShim(PyObject** args) { |
1678 | 1680 | // If we are supposed to be returning a primitive, it needs unboxing because |
1679 | 1681 | // our caller expected this to be a static->static direct invoke, we just |
1680 | 1682 | // failed to JIT the callee. |
1681 | | - int optional, exact; |
1682 | | - PyTypeObject* ret_type = _PyClassLoader_ResolveType( |
1683 | | - _PyClassLoader_GetReturnTypeDescr(func), &optional, &exact); |
1684 | | - int ret_code = _PyClassLoader_GetTypeCode(ret_type); |
1685 | | - Py_DECREF(ret_type); |
| 1683 | + int ret_code = _PyClassLoader_ResolvePrimitiveType( |
| 1684 | + _PyClassLoader_GetReturnTypeDescr(func)); |
1686 | 1685 | if (ret_code != TYPED_OBJECT) { |
1687 | 1686 | // we can always unbox to 64-bit, the JIT will just ignore the higher bits. |
1688 | 1687 | // This means that overflow here will give weird results, but overflow in |
|
0 commit comments