File tree Expand file tree Collapse file tree 5 files changed +15
-1
lines changed Expand file tree Collapse file tree 5 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ smt::solver_print_queries(opt_smt_verbose);
2020smt::solver_tactic_verbose (opt_tactic_verbose);
2121config::debug = opt_debug;
2222config::max_offset_bits = opt_max_offset_in_bits;
23+ config::max_sizet_bits = opt_max_sizet_in_bits;
2324
2425func_names.insert(opt_funcs.begin(), opt_funcs.end());
2526
Original file line number Diff line number Diff line change @@ -141,4 +141,11 @@ llvm::cl::opt<unsigned> opt_max_offset_in_bits(
141141 " offset computations exceed the maximum." ),
142142 llvm::cl::cat(alive_cmdargs));
143143
144+ llvm::cl::opt<unsigned > opt_max_sizet_in_bits (
145+ LLVM_ARGS_PREFIX " max-sizet-in-bits" , llvm::cl::init(64 ),
146+ llvm::cl::desc(" Upper bound for the size of size_t. "
147+ " Note that this may impact correctness if the required "
148+ " address space size exceeds the specified limit." ),
149+ llvm::cl::cat(alive_cmdargs));
150+
144151}
Original file line number Diff line number Diff line change @@ -1038,6 +1038,7 @@ static void calculateAndInitConstants(Transform &t) {
10381038 // We need this assumption to support negative offsets.
10391039 bits_size_t = bit_width (max_alloc_size);
10401040 bits_size_t = min (max (bits_for_offset, bits_size_t ), bits_program_pointer-1 );
1041+ bits_size_t = min (bits_size_t , config::max_sizet_bits);
10411042
10421043 // +1 because the pointer after the object must be valid (can't overflow)
10431044 uint64_t loc_alloc_aligned_size
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ bool debug = false;
1919unsigned src_unroll_cnt = 0 ;
2020unsigned tgt_unroll_cnt = 0 ;
2121unsigned max_offset_bits = 64 ;
22+ unsigned max_sizet_bits = 64 ;
2223
2324ostream &dbg () {
2425 return *debug_os;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ extern bool symexec_print_each_value;
1212
1313extern bool skip_smt;
1414
15- // don't dumo if empty
15+ // don't dump if empty
1616extern std::string smt_benchmark_dir;
1717
1818extern bool disable_poison_input;
@@ -30,6 +30,10 @@ extern unsigned tgt_unroll_cnt;
3030// maximum.
3131extern unsigned max_offset_bits;
3232
33+ // Max bits for size_t. This limits the internal address space, like max block
34+ // size and size of pointers (not to be confused with program pointer size).
35+ extern unsigned max_sizet_bits;
36+
3337std::ostream &dbg ();
3438void set_debug (std::ostream &os);
3539
You can’t perform that action at this time.
0 commit comments