@@ -1283,60 +1283,31 @@ void goto_convertt::do_function_call_symbol(
1283
1283
{
1284
1284
do_printf (lhs, function, arguments, dest);
1285
1285
}
1286
- else if (identifier==" __assert_fail" )
1286
+ else if (identifier==" __assert_fail" ||
1287
+ identifier==" _assert" ||
1288
+ identifier==" __assert_c99" ||
1289
+ identifier==" _wassert" )
1287
1290
{
1288
1291
// __assert_fail is Linux
1289
1292
// These take four arguments:
1290
1293
// "expression", "file.c", line, __func__
1294
+ // klibc has __assert_fail with 3 arguments
1295
+ // "expression", "file.c", line
1291
1296
1292
- if (arguments.size ()!=4 )
1293
- {
1294
- err_location (function);
1295
- throw " `" +id2string (identifier)+" ' expected to have four arguments" ;
1296
- }
1297
-
1298
- const irep_idt description=
1299
- " assertion " +id2string (get_string_constant (arguments[0 ]));
1300
-
1301
- goto_programt::targett t=dest.add_instruction (ASSERT);
1302
- t->guard =false_exprt ();
1303
- t->source_location =function.source_location ();
1304
- t->source_location .set (" user-provided" , true );
1305
- t->source_location .set_property_class (ID_assertion);
1306
- t->source_location .set_comment (description);
1307
- // we ignore any LHS
1308
- }
1309
- else if (identifier==" _assert" )
1310
- {
1311
1297
// MingW has
1312
1298
// void _assert (const char*, const char*, int);
1313
1299
// with three arguments:
1314
1300
// "expression", "file.c", line
1315
1301
1316
- if (arguments.size ()!=3 )
1317
- {
1318
- err_location (function);
1319
- throw " `" +id2string (identifier)+" ' expected to have three arguments" ;
1320
- }
1321
-
1322
- const irep_idt description=
1323
- " assertion " +id2string (get_string_constant (arguments[0 ]));
1324
-
1325
- goto_programt::targett t=dest.add_instruction (ASSERT);
1326
- t->guard =false_exprt ();
1327
- t->source_location =function.source_location ();
1328
- t->source_location .set (" user-provided" , true );
1329
- t->source_location .set_property_class (ID_assertion);
1330
- t->source_location .set_comment (description);
1331
- // we ignore any LHS
1332
- }
1333
- else if (identifier==" __assert_c99" )
1334
- {
1335
1302
// This has been seen in Solaris 11.
1336
1303
// Signature:
1337
1304
// void __assert_c99(const char *desc, const char *file, int line, const char *func);
1338
1305
1339
- if (arguments.size ()!=4 )
1306
+ // _wassert is Windows. The arguments are
1307
+ // L"expression", L"file.c", line
1308
+
1309
+ if (arguments.size ()!=4 &&
1310
+ arguments.size ()!=3 )
1340
1311
{
1341
1312
err_location (function);
1342
1313
throw " `" +id2string (identifier)+" ' expected to have four arguments" ;
@@ -1402,28 +1373,6 @@ void goto_convertt::do_function_call_symbol(
1402
1373
1403
1374
const irep_idt description=
1404
1375
" assertion " +id2string (get_string_constant (arguments[3 ]));
1405
- goto_programt::targett t=dest.add_instruction (ASSERT);
1406
-
1407
- t->guard =false_exprt ();
1408
- t->source_location =function.source_location ();
1409
- t->source_location .set (" user-provided" , true );
1410
- t->source_location .set_property_class (ID_assertion);
1411
- t->source_location .set_comment (description);
1412
- // we ignore any LHS
1413
- }
1414
- else if (identifier==" _wassert" )
1415
- {
1416
- // This is Windows. The arguments are
1417
- // L"expression", L"file.c", line
1418
-
1419
- if (arguments.size ()!=3 )
1420
- {
1421
- err_location (function);
1422
- throw " `" +id2string (identifier)+" ' expected to have three arguments" ;
1423
- }
1424
-
1425
- const irep_idt description=
1426
- " assertion " +id2string (get_string_constant (arguments[0 ]));
1427
1376
1428
1377
goto_programt::targett t=dest.add_instruction (ASSERT);
1429
1378
t->guard =false_exprt ();
0 commit comments