{"record":{"id":"d45f58dd64e3eb12","repo":"oracle/graal","slug":"invalid-input-range","errorCode":null,"errorMessage":"Invalid input range: ","messagePattern":"Invalid input range: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccess.java","lineNumber":1056,"sourceCode":"     * match hosted unaligned read semantics.\n     */\n    @Override\n    public JavaConstant readPrimitiveArrayUnaligned(JavaConstant array, JavaKind kind, int offset) {\n        if (kind == null || !kind.isPrimitive() || kind == JavaKind.Void) {\n            throw new IllegalArgumentException(\"Expected a non-void primitive kind, got \" + kind);\n        }\n        if (!(array instanceof EspressoExternalObjectConstant objectConstant)) {\n            throw new IllegalArgumentException(\"Expected an EspressoExternalObjectConstant, got \" + safeGetClass(array));\n        }\n        EspressoResolvedObjectType arrayType = objectConstant.getType();\n        if (!(arrayType.isArray() && arrayType.getComponentType().isPrimitive())) {\n            throw new IllegalArgumentException(\"Source should be a primitive array, got \" + arrayType);\n        }\n        Value value = objectConstant.getValue();\n        long byteLength = value.getBufferSize();\n        int bytesToRead = kind.getByteCount();\n        if (offset < 0 || (long) offset + bytesToRead > byteLength) {\n            throw new IllegalArgumentException(\"Invalid input range: \" + offset + \"..\" + (offset + bytesToRead) + \" for buffer size \" + byteLength);\n        }\n        return switch (kind) {\n            case Boolean -> JavaConstant.forBoolean(value.readBufferByte(offset) != 0);\n            case Byte -> JavaConstant.forByte(value.readBufferByte(offset));\n            case Short -> JavaConstant.forShort(value.readBufferShort(ByteOrder.nativeOrder(), offset));\n            case Char -> JavaConstant.forChar((char) value.readBufferShort(ByteOrder.nativeOrder(), offset));\n            case Int -> JavaConstant.forInt(value.readBufferInt(ByteOrder.nativeOrder(), offset));\n            case Long -> JavaConstant.forLong(value.readBufferLong(ByteOrder.nativeOrder(), offset));\n            case Float -> JavaConstant.forFloat(value.readBufferFloat(ByteOrder.nativeOrder(), offset));\n            case Double -> JavaConstant.forDouble(value.readBufferDouble(ByteOrder.nativeOrder(), offset));\n            default -> throw new IllegalArgumentException(\"Unsupported kind: \" + kind);\n        };\n    }\n\n    @Override\n    public JavaConstant createHostProxy(Object hostTarget, ResolvedJavaType guestType) {\n        Objects.requireNonNull(hostTarget);\n        if (!(Objects.requireNonNull(guestType) instanceof EspressoExternalResolvedInstanceType espressoGuestType) || !espressoGuestType.isInterface()) {","sourceCodeStart":1038,"sourceCodeEnd":1074,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccess.java#L1038-L1074","documentation":"Error \"Invalid input range: \" thrown in oracle/graal.","triggerScenarios":"Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccess.java:1056 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Invalid input range:","solutions":["Fix the condition reported by the error: Invalid input range:","Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: Invalid input range:","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}