Commit e621c66d authored by Matthew Gaudet's avatar Matthew Gaudet
Browse files

Bug 1562146 - Handle zero-length spans in ScriptSource::substring r=jorendorff

Differential Revision: https://phabricator.services.mozilla.com/D46617

--HG--
extra : moz-landing-system : lando
parent f337906a
/***********************************************************************
************************************************************************
*****************************************************/
class z {
m
}
gcslice(0);
gc();
+disassemble('-r');
\ No newline at end of file
......@@ -2214,6 +2214,9 @@ JSFlatString* ScriptSource::substring(JSContext* cx, size_t start,
MOZ_ASSERT(start <= stop);
size_t len = stop - start;
if (!len) {
return cx->emptyString();
}
UncompressedSourceCache::AutoHoldEntry holder;
// UTF-8 source text.
......@@ -2241,6 +2244,9 @@ JSFlatString* ScriptSource::substringDontDeflate(JSContext* cx, size_t start,
MOZ_ASSERT(start <= stop);
size_t len = stop - start;
if (!len) {
return cx->emptyString();
}
UncompressedSourceCache::AutoHoldEntry holder;
// UTF-8 source text.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment