46
46
import static com .oracle .graal .python .builtins .PythonBuiltinClassType .TypeError ;
47
47
import static com .oracle .graal .python .builtins .PythonBuiltinClassType .ValueError ;
48
48
import static com .oracle .graal .python .builtins .objects .cext .hpy .GraalHPyDef .HPyType_BUILTIN_SHAPE_FLOAT ;
49
+ import static com .oracle .graal .python .builtins .objects .cext .hpy .GraalHPyDef .HPyType_BUILTIN_SHAPE_LEGACY ;
49
50
import static com .oracle .graal .python .builtins .objects .cext .hpy .GraalHPyDef .HPyType_BUILTIN_SHAPE_LIST ;
50
51
import static com .oracle .graal .python .builtins .objects .cext .hpy .GraalHPyDef .HPyType_BUILTIN_SHAPE_LONG ;
51
52
import static com .oracle .graal .python .builtins .objects .cext .hpy .GraalHPyDef .HPyType_BUILTIN_SHAPE_OBJECT ;
@@ -2325,7 +2326,7 @@ static Object doGeneric(GraalHPyContext hpyContext, Object type, Object dataOutV
2325
2326
2326
2327
static PythonObject createFromBuiltinShape (int builtinShape , Object type , Object dataPtr , PythonObjectFactory factory ) {
2327
2328
PythonObject result = switch (builtinShape ) {
2328
- case HPyType_BUILTIN_SHAPE_OBJECT -> factory .createPythonHPyObject (type , dataPtr );
2329
+ case HPyType_BUILTIN_SHAPE_LEGACY , HPyType_BUILTIN_SHAPE_OBJECT -> factory .createPythonHPyObject (type , dataPtr );
2329
2330
case HPyType_BUILTIN_SHAPE_TYPE -> throw CompilerDirectives .shouldNotReachHere ("built-in shape type not yet implemented" );
2330
2331
case HPyType_BUILTIN_SHAPE_LONG -> factory .createInt (type , BigInteger .ZERO );
2331
2332
case HPyType_BUILTIN_SHAPE_FLOAT -> factory .createFloat (type , 0.0 );
@@ -2334,7 +2335,7 @@ static PythonObject createFromBuiltinShape(int builtinShape, Object type, Object
2334
2335
case HPyType_BUILTIN_SHAPE_LIST -> factory .createList (type );
2335
2336
default -> throw CompilerDirectives .shouldNotReachHere (INVALID_BUILT_IN_SHAPE );
2336
2337
};
2337
- if (builtinShape != HPyType_BUILTIN_SHAPE_OBJECT ) {
2338
+ if (builtinShape != HPyType_BUILTIN_SHAPE_LEGACY && builtinShape != HPyType_BUILTIN_SHAPE_OBJECT ) {
2338
2339
GraalHPyData .setHPyNativeSpace (result , dataPtr );
2339
2340
}
2340
2341
return result ;
0 commit comments