public void EmitPtr(IBlockContext context)
 {
     EmitLoad(context);
     using ITempBlockVariable tempLocal =
               context.MakeTempVariable(FieldType.UnderlyingType(context.ModuleContext));
     tempLocal.EmitStore(context);
     tempLocal.EmitLoadPtr(context);
 }
Esempio n. 2
0
        /// <summary>
        /// Variant of the Emit when a pointer to the result of the expression is required, rather
        /// then the value itself.
        /// I.e. EmitPtr will leave a pointer on the stack where the result is stored.
        /// </summary>
        public virtual void EmitPtr(IBlockContext context)
        {
            using ITempBlockVariable tempLocal =
                      context.MakeTempVariable(ResultType(context).UnderlyingType(context.ModuleContext));
            EmitStore(context, tempLocal, true);

            if (context.HasErrors)
            {
                return;
            }

            tempLocal.EmitLoadPtr(context);
        }