Page MenuHomePhabricator

Fix "undefined offset" in hunk parser
AbandonedPublic

Authored by epriestley on Jan 22 2015, 7:55 PM.
Tags
None
Referenced Files
F15430420: D11468.diff
Mon, Mar 24, 7:35 AM
F15424701: D11468.id27564.diff
Sun, Mar 23, 12:01 AM
F15424462: D11468.diff
Sat, Mar 22, 10:32 PM
Unknown Object (File)
Tue, Feb 25, 6:06 PM
Unknown Object (File)
Feb 8 2025, 1:33 AM
Unknown Object (File)
Feb 8 2025, 1:33 AM
Unknown Object (File)
Feb 8 2025, 1:33 AM
Unknown Object (File)
Jan 23 2025, 10:30 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.