public static RuntimeIshtarField GetField(uint index, RuntimeIshtarClass owner, VeinModule module, CallFrame frame) { var name = module.GetFieldNameByIndex((int)index); var field = owner.FindField(name.Name); if (field is null) { FastFail(WNE.MISSING_FIELD, $"Field '{name}' not found in '{owner.FullName.NameWithNS}'", frame); ValidateLastError(); return(null); } return(field); }
public void ThrowException(RuntimeIshtarClass @class, string message) { this.exception = new CallFrameException() { value = IshtarGC.AllocObject(@class) }; if (@class.FindField("message") is null) { throw new InvalidOperationException($"Class '{@class.FullName}' is not contained 'message' field."); } this.exception.value->vtable[@class.Field["message"].vtable_offset] = IshtarMarshal.ToIshtarObject(message); }