Page MenuHomePhabricator

Fix "undefined offset" in hunk parser
AbandonedPublic

Authored by epriestley on Jan 22 2015, 7:55 PM.
Tags
None
Referenced Files
F19015089: D11468.diff
Nov 22 2025, 10:47 PM
F18854509: D11468.id.diff
Nov 1 2025, 12:20 AM
F18844059: D11468.diff
Oct 29 2025, 2:52 AM
F18807563: D11468.id27564.diff
Oct 19 2025, 2:22 AM
F18791571: D11468.id.diff
Oct 16 2025, 3:23 PM
F18791016: D11468.diff
Oct 15 2025, 10:50 PM
F18712372: D11468.diff
Sep 29 2025, 5:23 AM
F18634848: D11468.diff
Sep 16 2025, 11:50 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.