www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2350] New: Contracts with a naked body are indecent


           Summary: Contracts with a naked body are indecent
           Product: D
           Version: 1.034
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P4
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: clugdbug yahoo.com.au

It seems that in/out contracts assume that a stack frame has been set up. This
is not true for naked functions, so bad code is generated. Ideally, if the body
contains the keyword 'naked', in/out contracts should create and destroy a
stack frame.

void rude(int a)
in {
body {
        asm { naked; }

void main() {

Sep 09 2008