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

# lstore, lstore\_\<n>

An *lstore* instruction with operand `Index` is type safe and yields an outgoing type state `NextStackFrame`, if a store instruction with operand `Index` and type `long` is type safe and yields an outgoing type state `NextStackFrame`.

```
instructionIsTypeSafe(lstore(Index), Environment, _Offset, StackFrame,
                      NextStackFrame, ExceptionStackFrame) :-
    storeIsTypeSafe(Environment, Index, long, StackFrame, NextStackFrame),
    exceptionStackFrame(StackFrame, ExceptionStackFrame).
```

The instructions *lstore\_\<n>*, for 0 ≤ *n* ≤ 3, are type safe iff the equivalent *lstore* instruction is type safe.

```
instructionHasEquivalentTypeRule(lstore_0, lstore(0)).
instructionHasEquivalentTypeRule(lstore_1, lstore(1)).
instructionHasEquivalentTypeRule(lstore_2, lstore(2)).
instructionHasEquivalentTypeRule(lstore_3, lstore(3)).
```
