Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }