@@ -279,11 +279,19 @@ Object& KernelLoader::LoadEntireProgram(Program* program,
279
279
if (pair != NULL ) {
280
280
// At least two entries with content. Unless the content is the same
281
281
// 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 (
285
287
" 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);
287
295
}
288
296
} else {
289
297
UriToSourceTableEntry* tmp = new UriToSourceTableEntry ();
@@ -544,7 +552,7 @@ void KernelLoader::AnnotateNativeProcedures() {
544
552
for (intptr_t j = 0 ; j < annotation_count; ++j) {
545
553
const intptr_t tag = helper_.PeekTag ();
546
554
if (tag == kConstantExpression ) {
547
- helper_.ReadByte (); // Skip the tag.
555
+ helper_.ReadByte (); // Skip the tag.
548
556
helper_.ReadPosition (); // Skip fileOffset.
549
557
helper_.SkipDartType (); // Skip type.
550
558
@@ -675,7 +683,7 @@ void KernelLoader::LoadNativeExtensionLibraries() {
675
683
676
684
const intptr_t tag = helper_.PeekTag ();
677
685
if (tag == kConstantExpression ) {
678
- helper_.ReadByte (); // Skip the tag.
686
+ helper_.ReadByte (); // Skip the tag.
679
687
helper_.ReadPosition (); // Skip fileOffset.
680
688
helper_.SkipDartType (); // Skip type.
681
689
@@ -1874,7 +1882,7 @@ void KernelLoader::ReadVMAnnotations(const Library& library,
1874
1882
// TODO(sjindel): Refactor `ExternalName` handling to do this as well
1875
1883
// and avoid the "potential natives" list.
1876
1884
1877
- helper_.ReadByte (); // Skip the tag.
1885
+ helper_.ReadByte (); // Skip the tag.
1878
1886
helper_.ReadPosition (); // Skip fileOffset.
1879
1887
helper_.SkipDartType (); // Skip type.
1880
1888
const intptr_t offset_in_constant_table = helper_.ReadUInt ();
0 commit comments