Skip to content

Commit 1e3e5ef

Browse files
author
Dart CI
committed
Version 2.14.0-48.0.dev
Merge commit 'ac2cd2d73cbd470445be789784f9a30c6927a873' into 'dev'
2 parents ecdb943 + ac2cd2d commit 1e3e5ef

File tree

19 files changed

+119
-88
lines changed

19 files changed

+119
-88
lines changed

pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7276,6 +7276,15 @@ const MessageCode messageNonPartOfDirectiveInPart = const MessageCode(
72767276
tip:
72777277
r"""Try removing the other directives, or moving them to the library for which this is a part.""");
72787278

7279+
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
7280+
const Code<Null> codeNonPositiveArrayDimensions =
7281+
messageNonPositiveArrayDimensions;
7282+
7283+
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
7284+
const MessageCode messageNonPositiveArrayDimensions = const MessageCode(
7285+
"NonPositiveArrayDimensions",
7286+
message: r"""Array dimensions must be positive numbers.""");
7287+
72797288
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
72807289
const Template<Message Function(String name)>
72817290
templateNonSimpleBoundViaReference =

pkg/compiler/lib/src/js_emitter/headers.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ const String HOOKS_API_USAGE = """
2727
// directly. Instead, a closure that will invoke [main], and its arguments
2828
// [args] is passed to [dartMainRunner].
2929
//
30-
// dartDeferredLibraryLoader(uri, successCallback, errorCallback):
30+
// dartDeferredLibraryLoader(uri, successCallback, errorCallback, loadId):
3131
// if this function is defined, it will be called when a deferred library
3232
// is loaded. It should load and eval the javascript of `uri`, and call
3333
// successCallback. If it fails to do so, it should call errorCallback with
34-
// an error.
34+
// an error. The loadId argument is the deferred import that resulted in
35+
// this uri being loaded.
3536
//
3637
// dartCallInstrumentation(id, qualifiedName):
3738
// if this function is defined, it will be called at each entry of a

pkg/front_end/lib/src/api_unstable/vm.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export '../fasta/fasta_codes.dart'
5353
messageFfiExceptionalReturnNull,
5454
messageFfiExpectedConstant,
5555
messageFfiPackedAnnotationAlignment,
56+
messageNonPositiveArrayDimensions,
5657
noLength,
5758
templateFfiDartTypeMismatch,
5859
templateFfiEmptyStruct,

pkg/front_end/messages.status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ NonNullableOptOutImplicit/analyzerCode: Fail
606606
NonNullableOptOutImplicit/example: Fail
607607
NonPartOfDirectiveInPart/part_wrapped_script1: Fail
608608
NonPartOfDirectiveInPart/script1: Fail
609+
NonPositiveArrayDimensions/analyzerCode: Fail
609610
NotAConstantExpression/example: Fail
610611
NotAType/example: Fail
611612
NotAnLvalue/example: Fail

pkg/front_end/messages.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4646,6 +4646,11 @@ NonNullAwareSpreadIsNull:
46464646
<int>[...null];
46474647
}
46484648
4649+
NonPositiveArrayDimensions:
4650+
# Used by dart:ffi
4651+
template: "Array dimensions must be positive numbers."
4652+
external: test/ffi_test.dart
4653+
46494654
InvalidTypeVariableInSupertype:
46504655
template: "Can't use implicitly 'out' variable '#name' in an '#string2' position in supertype '#name2'."
46514656
script: >

pkg/vm/lib/transformations/ffi_definitions.dart

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'dart:math' as math;
99
import 'package:front_end/src/api_unstable/vm.dart'
1010
show
1111
messageFfiPackedAnnotationAlignment,
12+
messageNonPositiveArrayDimensions,
1213
templateFfiEmptyStruct,
1314
templateFfiFieldAnnotation,
1415
templateFfiFieldNull,
@@ -323,14 +324,24 @@ class _FfiDefinitionTransformer extends FfiTransformer {
323324
compoundClassDependencies[node].add(clazz);
324325
_checkPacking(node, packing, clazz, f);
325326
}
326-
if (arrayDimensions(type) != sizeAnnotations.single.length) {
327+
final dimensions = sizeAnnotations.single;
328+
if (arrayDimensions(type) != dimensions.length) {
327329
diagnosticReporter.report(
328330
templateFfiSizeAnnotationDimensions
329331
.withArguments(f.name.text),
330332
f.fileOffset,
331333
f.name.text.length,
332334
f.fileUri);
333335
}
336+
for (var dimension in dimensions) {
337+
if (dimension < 0) {
338+
diagnosticReporter.report(
339+
messageNonPositiveArrayDimensions, f.fileOffset,
340+
f.name.text.length,
341+
f.fileUri);
342+
success = false;
343+
}
344+
}
334345
} else {
335346
diagnosticReporter.report(
336347
templateFfiSizeAnnotation.withArguments(f.name.text),
@@ -478,8 +489,8 @@ class _FfiDefinitionTransformer extends FfiTransformer {
478489
final sizeAnnotations = _getArraySizeAnnotations(m).toList();
479490
if (sizeAnnotations.length == 1) {
480491
final arrayDimensions = sizeAnnotations.single;
481-
type = NativeTypeCfe(this, dartType,
482-
compoundCache: compoundCache, arrayDimensions: arrayDimensions);
492+
type = NativeTypeCfe(this, dartType, compoundCache: compoundCache,
493+
arrayDimensions: arrayDimensions);
483494
}
484495
} else if (isPointerType(dartType) || isCompoundSubtype(dartType)) {
485496
type = NativeTypeCfe(this, dartType, compoundCache: compoundCache);
@@ -749,7 +760,7 @@ class CompoundLayout {
749760
abstract class NativeTypeCfe {
750761
factory NativeTypeCfe(FfiTransformer transformer, DartType dartType,
751762
{List<int> arrayDimensions,
752-
Map<Class, CompoundNativeTypeCfe> compoundCache = const {}}) {
763+
Map<Class, CompoundNativeTypeCfe> compoundCache = const {}}) {
753764
if (transformer.isPrimitiveType(dartType)) {
754765
final clazz = (dartType as InterfaceType).classNode;
755766
final nativeType = transformer.getType(clazz);
@@ -772,7 +783,7 @@ abstract class NativeTypeCfe {
772783
}
773784
final elementType = transformer.arraySingleElementType(dartType);
774785
final elementCfeType =
775-
NativeTypeCfe(transformer, elementType, compoundCache: compoundCache);
786+
NativeTypeCfe(transformer, elementType, compoundCache: compoundCache);
776787
return ArrayNativeTypeCfe.multi(elementCfeType, arrayDimensions);
777788
}
778789
throw "Invalid type $dartType";
@@ -1135,8 +1146,8 @@ class ArrayNativeTypeCfe implements NativeTypeCfe {
11351146

11361147
ArrayNativeTypeCfe(this.elementType, this.length);
11371148

1138-
factory ArrayNativeTypeCfe.multi(
1139-
NativeTypeCfe elementType, List<int> dimensions) {
1149+
factory ArrayNativeTypeCfe.multi(NativeTypeCfe elementType,
1150+
List<int> dimensions) {
11401151
if (dimensions.length == 1) {
11411152
return ArrayNativeTypeCfe(elementType, dimensions.single);
11421153
}

runtime/observatory/BUILD.gn

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,7 @@ prebuilt_dart2js_action("build_observatory") {
2121
outputs += [ "$target_gen_dir/observatory/web/main.dart.js.map" ]
2222
}
2323

24-
version_string = exec_script("../../tools/make_version.py",
25-
[
26-
"--quiet",
27-
"--no_git_hash",
28-
], # Arguments to the script
29-
"trim string", # Input conversions
30-
[
31-
"../../tools/VERSION",
32-
"../tools/utils.py",
33-
]) # Dependencies
34-
3524
args = [
36-
"-DOBS_VER=${version_string}",
3725
"-o",
3826
rebase_path(output),
3927
"--packages=" + rebase_path("../../.packages"),

runtime/observatory/tests/service/bad_reload_test.dart

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// OtherResources=bad_reload/v1/main.dart
6+
// OtherResources=bad_reload/v2/main.dart
7+
58
import 'test_helper.dart';
69
import 'dart:async';
710
import 'dart:developer';
@@ -37,6 +40,14 @@ Future<String> invokeTest(Isolate isolate) async {
3740
return result.valueAsString as String;
3841
}
3942

43+
Future<void> invokeTestWithError(Isolate isolate) async {
44+
await isolate.reload();
45+
Library lib = isolate.rootLibrary;
46+
await lib.load();
47+
final result = await lib.evaluate('test()');
48+
expect(result.isError, isTrue);
49+
}
50+
4051
var tests = <IsolateTest>[
4152
// Stopped at 'debugger' statement.
4253
hasStoppedAtBreakpoint,
@@ -65,14 +76,13 @@ var tests = <IsolateTest>[
6576
);
6677
// Observe that it failed.
6778
expect(response['success'], isFalse);
68-
List notices = response['details']['notices'];
79+
List notices = response['notices'];
6980
expect(notices.length, equals(1));
7081
Map<String, dynamic> reasonForCancelling = notices[0];
7182
expect(reasonForCancelling['type'], equals('ReasonForCancelling'));
7283
expect(reasonForCancelling['message'], contains('library_isnt_here_man'));
7384

74-
String v2 = await invokeTest(spawnedIsolate);
75-
expect(v2, 'apple');
85+
await invokeTestWithError(spawnedIsolate);
7686
}
7787
];
7888

runtime/observatory/tests/service/service_kernel.status

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ valid_source_locations_test: Pass, Slow
77
[ $compiler == app_jitk ]
88
add_breakpoint_rpc_kernel_test: SkipByDesign # No incremental compiler available.
99
async_generator_breakpoint_test: SkipByDesign # No incremental compiler available.
10-
bad_reload_test: RuntimeError
1110
break_on_activation_test: SkipByDesign # No incremental compiler available.
1211
complex_reload_test: RuntimeError
1312
debugger_inspect_test: SkipByDesign # No incremental compiler available.
@@ -24,7 +23,6 @@ rewind_test: SkipByDesign # No incremental compiler available.
2423
sigquit_starts_service_test: SkipByDesign # Spawns a secondary process using Platform.executable.
2524

2625
[ $compiler == dartk ]
27-
bad_reload_test: RuntimeError # Issue 34025
2826
coverage_optimized_function_test: Pass, Slow
2927
evaluate_activation_test/instance: RuntimeError # http://dartbug.com/20047
3028
evaluate_activation_test/scope: RuntimeError # http://dartbug.com/20047

runtime/observatory_2/BUILD.gn

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,7 @@ prebuilt_dart2js_action("build_observatory") {
2121
outputs += [ "$target_gen_dir/observatory/web/main.dart.js.map" ]
2222
}
2323

24-
version_string = exec_script("../../tools/make_version.py",
25-
[
26-
"--quiet",
27-
"--no_git_hash",
28-
], # Arguments to the script
29-
"trim string", # Input conversions
30-
[
31-
"../../tools/VERSION",
32-
"../tools/utils.py",
33-
]) # Dependencies
34-
3524
args = [
36-
"-DOBS_VER=${version_string}",
3725
"-o",
3826
rebase_path(output),
3927
"--packages=" + rebase_path("../../.packages"),

0 commit comments

Comments
 (0)