@@ -279,11 +279,19 @@ Object& KernelLoader::LoadEntireProgram(Program* program,
279279 if (pair != NULL ) {
280280 // At least two entries with content. Unless the content is the same
281281 // that's not valid.
282- if (pair->sources ->CompareTo (script_source) != 0 ||
283- !pair->line_starts ->CanonicalizeEquals (line_starts)) {
284- FATAL (
282+ const bool src_differ = pair->sources ->CompareTo (script_source) != 0 ;
283+ const bool line_starts_differ =
284+ !pair->line_starts ->CanonicalizeEquals (line_starts);
285+ if (src_differ || line_starts_differ) {
286+ FATAL3 (
285287 " Invalid kernel binary: Contains at least two source entries "
286- " that do not agree." );
288+ " that do not agree. URI '%s', difference: %s. Subprogram count: "
289+ " %" Pd " ." ,
290+ uri_string.ToCString (),
291+ src_differ && line_starts_differ
292+ ? " src and line starts"
293+ : (src_differ ? " src" : " line starts" ),
294+ subprogram_count);
287295 }
288296 } else {
289297 UriToSourceTableEntry* tmp = new UriToSourceTableEntry ();
@@ -544,7 +552,7 @@ void KernelLoader::AnnotateNativeProcedures() {
544552 for (intptr_t j = 0 ; j < annotation_count; ++j) {
545553 const intptr_t tag = helper_.PeekTag ();
546554 if (tag == kConstantExpression ) {
547- helper_.ReadByte (); // Skip the tag.
555+ helper_.ReadByte (); // Skip the tag.
548556 helper_.ReadPosition (); // Skip fileOffset.
549557 helper_.SkipDartType (); // Skip type.
550558
@@ -675,7 +683,7 @@ void KernelLoader::LoadNativeExtensionLibraries() {
675683
676684 const intptr_t tag = helper_.PeekTag ();
677685 if (tag == kConstantExpression ) {
678- helper_.ReadByte (); // Skip the tag.
686+ helper_.ReadByte (); // Skip the tag.
679687 helper_.ReadPosition (); // Skip fileOffset.
680688 helper_.SkipDartType (); // Skip type.
681689
@@ -1874,7 +1882,7 @@ void KernelLoader::ReadVMAnnotations(const Library& library,
18741882 // TODO(sjindel): Refactor `ExternalName` handling to do this as well
18751883 // and avoid the "potential natives" list.
18761884
1877- helper_.ReadByte (); // Skip the tag.
1885+ helper_.ReadByte (); // Skip the tag.
18781886 helper_.ReadPosition (); // Skip fileOffset.
18791887 helper_.SkipDartType (); // Skip type.
18801888 const intptr_t offset_in_constant_table = helper_.ReadUInt ();
0 commit comments