public void Setup()
        {
            exit = new ExternalProcedure("exit", 
                new ProcedureSignature(null, new Identifier("retCode", PrimitiveType.Int32, new StackArgumentStorage(0, PrimitiveType.Int32))));
            exit.Characteristics = new ProcedureCharacteristics();
            exit.Characteristics.Terminates = true;

            progMock = new ProgramBuilder();
            flow = new ProgramDataFlow();
        }
        private bool ProcedureTerminates(ProcedureBase proc)
        {
            if (proc.Characteristics != null && proc.Characteristics.Terminates)
                return true;
            var callee = proc as Procedure;
            if (callee == null)
                return false;

            return (callee != null && flow[callee].TerminatesProcess);
        }
Exemple #3
0
 public Statement Call(ProcedureBase callee, int retSizeOnStack)
 {
     ProcedureConstant c = new ProcedureConstant(PrimitiveType.Pointer32, callee);
     CallInstruction ci = new CallInstruction(c, new CallSite(retSizeOnStack, 0));  
     return Emit(ci);
 }
		public void VisitProcedure(ProcedureBase proc)
		{
			if (proc.Signature != null)
			{
				if (proc.Signature.TypeVariable == null)
				{
					proc.Signature.TypeVariable = store.EnsureExpressionTypeVariable(
						factory,
                        new Identifier("signature of " + proc.Name, VoidType.Instance, null),
						null);
				}
				if (proc.Signature.Parameters != null)
				{
					foreach (Identifier id in proc.Signature.Parameters)
					{
						id.Accept(this);
					}
				}
				//$REVIEW: return type?
			}
		}
 public ProcedureTextSpan(ProcedureBase proc, Address addr)
 {
     this.proc = proc;
     this.Tag = addr;
     this.Style = "addrText";
 }
Exemple #6
0
		public virtual ProcedureSignature GetProcedureSignature(ProcedureBase proc)
		{
			return proc.Signature;
		}