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);
|
value = getValueRangeFromValueType(&vt, data);
|
||||||
} else
|
} else
|
||||||
return ExprEngine::ValuePtr();
|
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 std::make_shared<ExprEngine::ArrayValue>(data.getNewSymbolName(), bufferSize, value, false, false, false);
|
||||||
}
|
}
|
||||||
return getValueRangeFromValueType(data.getNewSymbolName(), valueType, *data.settings);
|
return getValueRangeFromValueType(data.getNewSymbolName(), valueType, *data.settings);
|
||||||
|
|
|
@ -194,7 +194,7 @@ namespace ExprEngine {
|
||||||
// Array or pointer
|
// Array or pointer
|
||||||
class ArrayValue: public Value {
|
class ArrayValue: public Value {
|
||||||
public:
|
public:
|
||||||
const int MAXSIZE = 0x100000;
|
enum { MAXSIZE = 0x7fffffff };
|
||||||
|
|
||||||
ArrayValue(const std::string &name, ValuePtr size, ValuePtr value, bool pointer, bool nullPointer, bool uninitPointer);
|
ArrayValue(const std::string &name, ValuePtr size, ValuePtr value, bool pointer, bool nullPointer, bool uninitPointer);
|
||||||
ArrayValue(DataBase *data, const Variable *var);
|
ArrayValue(DataBase *data, const Variable *var);
|
||||||
|
|
|
@ -328,13 +328,13 @@ private:
|
||||||
Settings settings;
|
Settings settings;
|
||||||
LOAD_LIB_2(settings.library, "std.cfg");
|
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:26: $2=-128:127\n"
|
||||||
"1:27: 0:{ s=($4,[$3],[:]=$2)}\n",
|
"1:27: 0:{ s=($4,[$3],[:]=$2)}\n",
|
||||||
trackExecution("void foo() { std::string s; }", &settings));
|
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:52: $2=-128:127\n"
|
||||||
"1:66: 0:{ s=($4,[$3],[:]=$2)}\n",
|
"1:66: 0:{ s=($4,[$3],[:]=$2)}\n",
|
||||||
trackExecution("std::string getName(int); void foo() { std::string s = getName(1); }", &settings));
|
trackExecution("std::string getName(int); void foo() { std::string s = getName(1); }", &settings));
|
||||||
|
|
Loading…
Reference in New Issue