Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r228975 - Null-dereference of the second argument
resource
of…
… DocumentLoader::scheduleSubstituteResourceLoad https://bugs.webkit.org/show_bug.cgi?id=182920 Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-02-24 Reviewed by Darin Adler. A test case imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker.html always crashes due to a null-dereference if compiled and optimized by GCC 7.2. The second argument `resource` of DocumentLoader::scheduleSubstituteResourceLoad can be null if the resource can't be found in cache. I guess GCC optimizes inline HashMap::add based on assuming the `resource` never becomes null because its type is SubstituteResource&. This changes introduces a new method DocumentLoader::scheduleCannotShowURLError because it looks tricky to pass a nullptr to the second argument of scheduleSubstituteResourceLoad. No new tests (Covered by existing tests). * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::scheduleCannotShowURLError): Added a new method. * loader/DocumentLoader.h: * loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::maybeLoadResource): Call scheduleCannotShowURLError if the resource not found in the appcache.
- Loading branch information
1 parent
c39317f
commit 0820d5c
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters