152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
if( !cfg )
return PoisonValue();
if( cfg->isPoisoned() )
return PoisonValue();
if( c.returnType() != GetValueType< void >()
&& !cfg->areAllBBTerminated() )
{
pFuncLLR->setInvalid();
// TODO the return statement should always be optional at the top level of a file,
// so we should be passed a default return value as parameter and insert return
// statements automatically wherever they may be missing in the cfg.
DiagnosticsManager::GetInstance().emitErrorMessage( 0,
format( "{}: missing return statement in a function with non-void return type.", filename ) );
return ToValue( func ).setPoison();
}
pFuncLLR->body() = cfg;
return ToValue( func );
} );
}
}
|
<
<
<
<
<
<
<
<
<
<
<
<
<
|
152
153
154
155
156
157
158
159
160
161
162
163
|
if( !cfg )
return PoisonValue();
if( cfg->isPoisoned() )
return PoisonValue();
pFuncLLR->body() = cfg;
return ToValue( func );
} );
}
}
|