Skip to content

Latest commit

 

History

History
36 lines (22 loc) · 2.02 KB

iii.3.17-brfalse.length.md

File metadata and controls

36 lines (22 loc) · 2.02 KB

III.3.17 brfalse.<length> – branch on false, null, or zero

Format Assembly Format Description
39 <int32> brfalse target Branch to target if value is zero (false).
2C <int8> brfalse.s target Branch to target if value is zero (false), short form.
39 <int32> brnull target Branch to target if value is null (alias for brfalse).
2C <int8> brnull.s target Branch to target if value is null (alias for brfalse.s), short form.
39 <int32> brzero target Branch to target if value is zero (alias for brfalse).
2C <int8> brzero.s target Branch to target if value is zero (alias for brfalse.s), short form.

Stack Transition:

…, value → …

Description:

The brfalse instruction transfers control to target if value (of type int32, int64, object reference, managed pointer, unmanaged pointer or native int) is zero (false). If value is nonzero (true), execution continues at the next instruction.

target is represented as a signed offset (4 bytes for brfalse, 1 byte for brfalse.s) from the beginning of the instruction following the current instruction.

If the target instruction has one or more prefix codes, control can only be transferred to the first of these prefixes.

Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction. (Such transfers are severely restricted and shall use the leave instruction instead; see Partition I for details).

Exceptions:

None.

Correctness:

Correct CIL shall observe all of the control transfer rules specified above and shall guarantee there is a minimum of one item on the stack.

Verifiability:

Verifiable code requires the type-consistency of the stack, locals and arguments for every possible path to the destination instruction. See §III.1.8 for more details.