Bug 1452441 - Fix infinite recursion in testBinASTReader for Windows;r=Yoric

MozReview-Commit-ID: Fwv0VgPpv4v

--HG--
extra : rebase_source : e2dae7776ade6274cfc37b8fb9be99f2331110b9
This commit is contained in:
David Teller 2018-04-08 09:46:07 +02:00
parent 1a33352c38
commit b7121e1a4d
2 changed files with 9 additions and 3 deletions

View File

@ -144,7 +144,7 @@ if CONFIG['NIGHTLY_BUILD']:
'testErrorInterceptor.cpp',
]
if CONFIG['JS_BUILD_BINAST'] and CONFIG['JS_STANDALONE'] and CONFIG['OS_TARGET'] != 'WINNT':
if CONFIG['JS_BUILD_BINAST'] and CONFIG['JS_STANDALONE']:
# Standalone builds leave the source directory untouched,
# which lets us run tests with the data files intact.
# Otherwise, in the current state of the build system,

View File

@ -81,11 +81,17 @@ runTestFromPath(JSContext* cx, const char* path)
#elif defined(XP_WIN)
MOZ_ASSERT(path[pathlen - 1] == '\\');
const char PATTERN[] = "*";
Vector<char> pattern(cx);
if (!pattern.append(path, pathlen))
MOZ_CRASH();
if (!pattern.append('*'))
MOZ_CRASH();
if (!pattern.append('\0'))
MOZ_CRASH();
WIN32_FIND_DATA FindFileData;
enterJsDirectory();
HANDLE hFind = FindFirstFile(PATTERN, &FindFileData);
HANDLE hFind = FindFirstFile(pattern.begin(), &FindFileData);
exitJsDirectory();
for (bool found = (hFind != INVALID_HANDLE_VALUE);
found;