Table of Contents

Struct CilDispatchResult

Namespace
Echo.Platforms.AsmResolver.Emulation.Dispatch
Assembly
Echo.Platforms.AsmResolver.dll

Provides information about the result of an instruction dispatch.

public readonly struct CilDispatchResult : IEquatable<CilDispatchResult>
Implements
Inherited Members

Properties

ExceptionObject

When IsSuccess is false, gets the o that represents the pointer to the exception that was thrown during the evaluation of the instruction.

public ObjectHandle ExceptionObject { get; }

Property Value

ObjectHandle

IsSuccess

Gets a value indicating whether the dispatch and evaluation of the instruction was successful.

public bool IsSuccess { get; }

Property Value

bool

Methods

Equals(CilDispatchResult)

public bool Equals(CilDispatchResult other)

Parameters

other CilDispatchResult

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Exception(CilVirtualMachine, ITypeDescriptor)

Creates a new dispatch result indicating the dispatch failed with an exception.

public static CilDispatchResult Exception(CilVirtualMachine machine, ITypeDescriptor type)

Parameters

machine CilVirtualMachine

The machine to allocate the exception in.

type ITypeDescriptor

The type of exception to allocate.

Returns

CilDispatchResult

Exception(ObjectHandle)

Creates a new dispatch result indicating the dispatch failed with an exception.

public static CilDispatchResult Exception(ObjectHandle exceptionObject)

Parameters

exceptionObject ObjectHandle

The handle to the exception object that was thrown.

Returns

CilDispatchResult

GetHashCode()

public override int GetHashCode()

Returns

int

IndexOutOfRange(CilExecutionContext)

Creates a new dispatch result indicating the dispatch failed due to an index being out of range.

public static CilDispatchResult IndexOutOfRange(CilExecutionContext context)

Parameters

context CilExecutionContext

The context the instruction was evaluated in.

Returns

CilDispatchResult

InvalidCast(CilExecutionContext, TypeSignature, TypeSignature)

Creates a new dispatch result indicating the dispatch failed due to a stack overflow.

public static CilDispatchResult InvalidCast(CilExecutionContext context, TypeSignature originalType, TypeSignature targetType)

Parameters

context CilExecutionContext

The context the instruction was evaluated in.

originalType TypeSignature

The original object type.

targetType TypeSignature

The type that the object was attempted to be casted to.

Returns

CilDispatchResult

InvalidProgram(CilExecutionContext)

Creates a new dispatch result indicating the dispatch failed due to an invalid program.

public static CilDispatchResult InvalidProgram(CilExecutionContext context)

Parameters

context CilExecutionContext

The context the instruction was evaluated in.

Returns

CilDispatchResult

NullReference(CilExecutionContext)

Creates a new dispatch result indicating the dispatch failed due to a null reference.

public static CilDispatchResult NullReference(CilExecutionContext context)

Parameters

context CilExecutionContext

The context the instruction was evaluated in.

Returns

CilDispatchResult

Overflow(CilExecutionContext)

Creates a new dispatch result indicating the dispatch failed due to an integer overflow.

public static CilDispatchResult Overflow(CilExecutionContext context)

Parameters

context CilExecutionContext

The context the instruction was evaluated in.

Returns

CilDispatchResult

StackOverflow(CilExecutionContext)

Creates a new dispatch result indicating the dispatch failed due to a stack overflow.

public static CilDispatchResult StackOverflow(CilExecutionContext context)

Parameters

context CilExecutionContext

The context the instruction was evaluated in.

Returns

CilDispatchResult

Success()

Creates a new dispatch result indicating the dispatch was successful.

public static CilDispatchResult Success()

Returns

CilDispatchResult

ToString()

public override string ToString()

Returns

string