Skip to content

Commit d5792fe

Browse files
Enable bounds checking in Debug and ReleaseSafe Mode
1 parent 6d8ab22 commit d5792fe

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/bin/lpython.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,10 +1293,6 @@ int main(int argc, char *argv[])
12931293
app.add_flag("--show-errors", show_errors, "Show errors when LSP is running in the background");
12941294
app.add_flag("--show-document-symbols", show_document_symbols, "Show symbols in lpython file");
12951295

1296-
if( compiler_options.fast ) {
1297-
lpython_pass_manager.use_optimization_passes();
1298-
}
1299-
13001296
/*
13011297
* Subcommands:
13021298
*/
@@ -1329,6 +1325,16 @@ int main(int argc, char *argv[])
13291325
app.require_subcommand(0, 1);
13301326
CLI11_PARSE(app, argc, argv);
13311327

1328+
if( compiler_options.fast && compiler_options.enable_bounds_checking ) {
1329+
// ReleaseSafe Mode
1330+
} else if ( compiler_options.fast ) {
1331+
// Release Mode
1332+
lpython_pass_manager.use_optimization_passes();
1333+
} else {
1334+
// Debug Mode
1335+
compiler_options.enable_bounds_checking = true;
1336+
}
1337+
13321338
if (arg_version) {
13331339
std::string version = LFORTRAN_VERSION;
13341340
std::cout << "LPython version: " << version << std::endl;

0 commit comments

Comments
 (0)