@@ -981,29 +981,28 @@ struct Abc9Pass : public Pass {
981
981
// }
982
982
if (arg == " -lut" && argidx+1 < args.size ()) {
983
983
string arg = args[++argidx];
984
- size_t pos = arg.find_first_of (' :' );
985
- int lut_mode = 0 , lut_mode2 = 0 ;
986
- if (pos != string::npos) {
987
- lut_mode = atoi (arg.substr (0 , pos).c_str ());
988
- lut_mode2 = atoi (arg.substr (pos+1 ).c_str ());
989
- } else {
990
- pos = arg.find_first_of (' .' );
984
+ if (arg.find_first_not_of (" 0123456789:" ) == std::string::npos) {
985
+ size_t pos = arg.find_first_of (' :' );
986
+ int lut_mode = 0 , lut_mode2 = 0 ;
991
987
if (pos != string::npos) {
992
- lut_file = arg;
993
- rewrite_filename (lut_file);
994
- if (!lut_file.empty () && !is_absolute_path (lut_file))
995
- lut_file = std::string (pwd) + " /" + lut_file;
996
- }
997
- else {
988
+ lut_mode = atoi (arg.substr (0 , pos).c_str ());
989
+ lut_mode2 = atoi (arg.substr (pos+1 ).c_str ());
990
+ } else {
998
991
lut_mode = atoi (arg.c_str ());
999
992
lut_mode2 = lut_mode;
1000
993
}
994
+ lut_costs.clear ();
995
+ for (int i = 0 ; i < lut_mode; i++)
996
+ lut_costs.push_back (1 );
997
+ for (int i = lut_mode; i < lut_mode2; i++)
998
+ lut_costs.push_back (2 << (i - lut_mode));
999
+ }
1000
+ else {
1001
+ lut_file = arg;
1002
+ rewrite_filename (lut_file);
1003
+ if (!lut_file.empty () && !is_absolute_path (lut_file) && lut_file[0 ] != ' +' )
1004
+ lut_file = std::string (pwd) + " /" + lut_file;
1001
1005
}
1002
- lut_costs.clear ();
1003
- for (int i = 0 ; i < lut_mode; i++)
1004
- lut_costs.push_back (1 );
1005
- for (int i = lut_mode; i < lut_mode2; i++)
1006
- lut_costs.push_back (2 << (i - lut_mode));
1007
1006
continue ;
1008
1007
}
1009
1008
if (arg == " -luts" && argidx+1 < args.size ()) {
@@ -1072,7 +1071,7 @@ struct Abc9Pass : public Pass {
1072
1071
box_file = " +/dummy.box" ;
1073
1072
1074
1073
rewrite_filename (box_file);
1075
- if (!box_file.empty () && !is_absolute_path (box_file))
1074
+ if (!box_file.empty () && !is_absolute_path (box_file) && box_file[ 0 ] != ' + ' )
1076
1075
box_file = std::string (pwd) + " /" + box_file;
1077
1076
1078
1077
dict<int ,IdString> box_lookup;
0 commit comments