exprengine: Use and tweak ExprEngine::ArrayValue::MAXSIZE
This commit is contained in:
parent
40a5afb7fc
commit
b052843655
|
@ -1506,7 +1506,7 @@ static ExprEngine::ValuePtr getValueRangeFromValueType(const ValueType *valueTyp
|
|||
value = getValueRangeFromValueType(&vt, data);
|
||||
} else
|
||||
return ExprEngine::ValuePtr();
|
||||
auto bufferSize = std::make_shared<ExprEngine::IntRange>(data.getNewSymbolName(), 0, ~0U);
|
||||
auto bufferSize = std::make_shared<ExprEngine::IntRange>(data.getNewSymbolName(), 0, ExprEngine::ArrayValue::MAXSIZE);
|
||||
return std::make_shared<ExprEngine::ArrayValue>(data.getNewSymbolName(), bufferSize, value, false, false, false);
|
||||
}
|
||||
return getValueRangeFromValueType(data.getNewSymbolName(), valueType, *data.settings);
|
||||
|
|
|
@ -194,7 +194,7 @@ namespace ExprEngine {
|
|||
// Array or pointer
|
||||
class ArrayValue: public Value {
|
||||
public:
|
||||
const int MAXSIZE = 0x100000;
|
||||
enum { MAXSIZE = 0x7fffffff };
|
||||
|
||||
ArrayValue(const std::string &name, ValuePtr size, ValuePtr value, bool pointer, bool nullPointer, bool uninitPointer);
|
||||
ArrayValue(DataBase *data, const Variable *var);
|
||||
|
|
|
@ -328,13 +328,13 @@ private:
|
|||
Settings settings;
|
||||
LOAD_LIB_2(settings.library, "std.cfg");
|
||||
|
||||
ASSERT_EQUALS("1:26: $3=0:ffffffff\n"
|
||||
ASSERT_EQUALS("1:26: $3=0:2147483647\n"
|
||||
"1:26: $2=-128:127\n"
|
||||
"1:27: 0:{ s=($4,[$3],[:]=$2)}\n",
|
||||
trackExecution("void foo() { std::string s; }", &settings));
|
||||
|
||||
|
||||
ASSERT_EQUALS("1:52: $3=0:ffffffff\n"
|
||||
ASSERT_EQUALS("1:52: $3=0:2147483647\n"
|
||||
"1:52: $2=-128:127\n"
|
||||
"1:66: 0:{ s=($4,[$3],[:]=$2)}\n",
|
||||
trackExecution("std::string getName(int); void foo() { std::string s = getName(1); }", &settings));
|
||||
|
|
Loading…
Reference in New Issue