Skip to content

Commit

Permalink
fix determin lib name varation logic (dotnet#79370)
Browse files Browse the repository at this point in the history
When checking whether the suffix is contained, the size calcuation is wrong.

In case of Linux, u".so" is defined to PLATFORM_SHARED_LIB_SUFFIX_W.
So, string length (3) should be added to iterator.
But, in the current implementation, ARRAY_SIZE(PLATFORM_SHARED_LIB_SUFFIX_W) (4) is added to iterator.
  • Loading branch information
wscho77 authored Dec 9, 2022
1 parent 0b7fd63 commit a4fa4c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coreclr/vm/nativelibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ namespace
SString::CIterator it = libName.Begin();
if (libName.Find(it, PLATFORM_SHARED_LIB_SUFFIX_W))
{
it += ARRAY_SIZE(PLATFORM_SHARED_LIB_SUFFIX_W);
it += (ARRAY_SIZE(PLATFORM_SHARED_LIB_SUFFIX_W) - 1);
containsSuffix = it == libName.End() || *it == (WCHAR)'.';
}

Expand Down

0 comments on commit a4fa4c4

Please sign in to comment.