Skip to content

Commit 8deb855

Browse files
committed
Fix ValueType::matchParameter for 'const float *' => 'signed long long'
1 parent 91ca616 commit 8deb855

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎lib/symboldatabase.cpp‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5807,11 +5807,7 @@ ValueType::MatchResult ValueType::matchParameter(const ValueType *call, const Va
58075807
if (call->pointer != func->pointer) {
58085808
if (call->pointer > 1 && func->pointer == 1 && func->type == ValueType::Type::VOID)
58095809
return ValueType::MatchResult::FALLBACK1;
5810-
if (call->pointer < func->pointer && !call->isIntegral())
5811-
return ValueType::MatchResult::NOMATCH;
5812-
if (func->pointer < call->pointer && !func->isIntegral())
5813-
return ValueType::MatchResult::NOMATCH;
5814-
return ValueType::MatchResult::UNKNOWN; // TODO
5810+
return ValueType::MatchResult::NOMATCH; // TODO
58155811
}
58165812
if (call->pointer > 0 && ((call->constness | func->constness) != func->constness))
58175813
return ValueType::MatchResult::NOMATCH;

‎test/testsymboldatabase.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5547,6 +5547,10 @@ class TestSymbolDatabase: public TestFixture {
55475547

55485548
ValueType vt_char_pointer2(ValueType::Sign::SIGNED, ValueType::Type::CHAR, 2);
55495549
ASSERT_EQUALS((int)ValueType::MatchResult::FALLBACK1, (int)ValueType::matchParameter(&vt_char_pointer2, &vt_void_pointer));
5550+
5551+
ValueType vt_const_float_pointer(ValueType::Sign::UNKNOWN_SIGN, ValueType::Type::FLOAT, 1, 1);
5552+
ValueType vt_long_long(ValueType::Sign::SIGNED, ValueType::Type::LONGLONG, 0, 0);
5553+
ASSERT_EQUALS((int)ValueType::MatchResult::NOMATCH, (int)ValueType::matchParameter(&vt_const_float_pointer, &vt_long_long));
55505554
}
55515555

55525556
#define FUNC(x) const Function *x = findFunctionByName(#x, &db->scopeList.front()); \

0 commit comments

Comments
 (0)