Page MenuHomePhabricator

Fix "undefined offset" in hunk parser
AbandonedPublic

Authored by epriestley on Jan 22 2015, 7:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 1:48 PM
Unknown Object (File)
Sun, Nov 24, 3:52 AM
Unknown Object (File)
Thu, Nov 21, 1:40 PM
Unknown Object (File)
Sun, Nov 17, 10:44 AM
Unknown Object (File)
Oct 22 2024, 3:39 AM
Unknown Object (File)
Oct 16 2024, 11:53 PM
Unknown Object (File)
Oct 14 2024, 8:01 AM
Unknown Object (File)
Oct 9 2024, 1:32 PM
Subscribers

Details

Summary

Fixes T5163. Fixes the following error from occurring when viewing certain diffs:

ERROR 8: Undefined offset: 2 at [/usr/src/phabricator/src/applications/differential/parser/DifferentialHunkParser.php:99]
  #0 DifferentialHunkParser::setOldLineTypeMap(array) called at [<phabricator>/src/applications/differential/parser/DifferentialChangesetParser.php:587]
  #1 DifferentialChangesetParser::process() called at [<phabricator>/src/applications/differential/parser/DifferentialChangesetParser.php:517]
  #2 DifferentialChangesetParser::tryCacheStuff() called at [<phabricator>/src/applications/differential/parser/DifferentialChangesetParser.php:734]
  #3 DifferentialChangesetParser::render(NULL, NULL, array) called at [<phabricator>/src/applications/differential/controller/DifferentialChangesetViewController.php:217]
  #4 DifferentialChangesetViewController::processRequest() called at [<phabricator>/src/aphront/AphrontController.php:33]
  #5 AphrontController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:196]
  #6 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:121]
  #7 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:19]
Test Plan

Uploaded and viewed the following diff in Differential:

diff --git a/test b/test
index 0519ecb..8d1c8b6 100644
--- a/test
+++ b/test
@@ -1 +1 @@
- 
\ No newline at end of file
+ 

Diff Detail

Event Timeline

joshuaspence retitled this revision from to Fix "undefined offset" in hunk parser.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

Per D11465, let's get that diff covered with a rendering test? 99% sure that's trivial.

This revision now requires changes to proceed.Jan 22 2015, 8:14 PM
epriestley edited reviewers, added: joshuaspence; removed: epriestley.

Rolled into D11970, with coverage.