---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 14 Edition"
java_version: 14
chapter: "Chapter 4. The class File Format"
section: "4.10.1.9.bastore"
heading: "bastore"
parent: "4.10.1.9. Type Checking Instructions"
source: https://docs.oracle.com/javase/specs/jvms/se14/html/jvms-4.html#jvms-4.10.1.9.bastore
id: "4.10.1.9.bastore"
url: https://jvm.obfuscated.software/jvms/se14/4.10.1.9.bastore.html
raw: https://jvm.obfuscated.software/jvms/se14/4.10.1.9.bastore.md
---

# bastore

A *bastore* instruction is type safe iff one can validly pop types matching `int`, `int` and a small array type off the incoming operand stack yielding the outgoing type state.

```
instructionIsTypeSafe(bastore, _Environment, _Offset, StackFrame,
                      NextStackFrame, ExceptionStackFrame) :-
    nth1OperandStackIs(3, StackFrame, ArrayType),
    isSmallArray(ArrayType),
    canPop(StackFrame, [int, int, top], NextStackFrame),
    exceptionStackFrame(StackFrame, ExceptionStackFrame).
```
