Commit Graph

9 Commits

Author SHA1 Message Date
Ryan Macnak cd5b99154f [vm] Fix potential upref of null in GenerateAppAOTAsAssembly.
Fixes GCC TSAN build.

TEST=local build
Change-Id: I8e7829835b412a9f5fdf638c793d6acf4a2dc501
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472664
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-01-20 09:49:35 -08:00
Ryan Macnak 3c298dbca5 [vm] Update to constexpr in runtime/bin.
TEST=build
Change-Id: I18fc7cfe725dc978d4b23de6191e455ac7cd75e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293800
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-04-12 20:32:29 +00:00
Ryan Macnak b68351fbc3 [vm] Update NULL to nullptr in runtime/bin.
TEST=build
Change-Id: Ie3be570c274b0275a995a0f54b5e6ccdfc77ccd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292287
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2023-04-12 01:11:05 +00:00
Daco Harkes 202e32afeb [vm] Native API: Introduce Dart_FinalizableHandle
Introduces Dart_NewFinalizableHandle which does auto delete itself,
but does not allow accessing the weak referenced object.

Issue: https://github.com/dart-lang/sdk/issues/42312

Change-Id: I24ea732925122c453213c4fa3f629761c352f838
Cq-Include-Trybots:dart/try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154695
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-07-23 11:30:39 +00:00
Ryan Macnak d08c203e30 Add various missing argument checks to dart:io natives.
Avoid reflective access to mirrors creating invalid reflectees.

Change type checks in embedding API functions to return UnhandledExceptionErrors instead of APIErrors so they are catchable by Dart.

Fixes invocation_fuzz_test.

Bug: https://github.com/dart-lang/sdk/issues/15274
Bug: https://github.com/dart-lang/sdk/issues/23869
Bug: https://github.com/dart-lang/sdk/issues/37680
Change-Id: Ife3e3cb894c59620b0318e4e08947a3d1d45bab9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110620
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-08-01 23:32:40 +00:00
Ryan Macnak 938d3be958 Revert "Add various missing argument checks to dart:io natives."
This reverts commit ba72890aa7.

Reason for revert: Crash in bytecode modes

Original change's description:
> Add various missing argument checks to dart:io natives.
> 
> Change type checks in embedding API functions to return UnhandledExceptionErrors instead of APIErrors so they are catchable by Dart.
> 
> Fixes invocation_fuzz_test.
> 
> Bug: https://github.com/dart-lang/sdk/issues/15274
> Bug: https://github.com/dart-lang/sdk/issues/23869
> Change-Id: Ia6103e7ffceda897e475c1a3ba534c2f4b910475
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110020
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=sortie@google.com,rmacnak@google.com,asiva@google.com

Change-Id: Ib52ec03caf4b177cd91bb1d366df51588bf23177
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/15274, https://github.com/dart-lang/sdk/issues/23869
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110580
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-07-25 19:18:23 +00:00
Ryan Macnak ba72890aa7 Add various missing argument checks to dart:io natives.
Change type checks in embedding API functions to return UnhandledExceptionErrors instead of APIErrors so they are catchable by Dart.

Fixes invocation_fuzz_test.

Bug: https://github.com/dart-lang/sdk/issues/15274
Bug: https://github.com/dart-lang/sdk/issues/23869
Change-Id: Ia6103e7ffceda897e475c1a3ba534c2f4b910475
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110020
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-07-25 16:40:04 +00:00
Zachary Anderson 7fd15110fe [dart:io] chdir, getcwd when in a namespace
This change does a couple things:
- When there is a non-default namespace, on Linux, Android, and Fuchsia
  the current working directory is per-Isolate.
- On Fuchsia, it caches the fd from fdio_ns_t instead of recomputing it
  on every fs access.

Change-Id: I3735330884de51ca853a17d66dcfcfa984b9a041
Reviewed-on: https://dart-review.googlesource.com/9367
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-10-09 19:14:58 +00:00
Zachary Anderson d0295c873c [dart:io] Namespaces for file IO
Fuchsia requires the ability to sandbox Isolates w.r.t. file IO.
When a new Isolate starts, Fuchsia will pass the Isolate an object
called a namespace. We can translate the namespace object into a
file descriptor suitable for passing to the *at() family of
POSIX file system calls. The file system calls will then
have visibility only into the specified namespace.

We also plumb Namespaces through on all the other platforms as well to
make the change easier to test and so that in the future we can
implement e.g. per-isolate cwds.

This change adds a new internal class to dart:io called _Namespace,
which is implemented in a patch file. See:

sdk/lib/io/namespace_impl.dart
runtime/bin/namespace_patch.dart

The embedder can set up a non-default namespace by calling
_Namespace._setupNamespace during Isolate setup.

Instances of _Namespace have a native field that holds a pointer
to a native Namespace object. See:

runtime/bin/namespace.h

Calls from e.g. file_impl.dart are now also passed a
_Namespace object. The implementations in e.g. file.cc and
file_linux.cc then extract the namespace, and use it to compute a
file descriptor and path suitable for passing to e.g. openat().

related US-313

R=asiva@google.com, rmacnak@google.com

Review-Url: https://codereview.chromium.org/3007703002 .
2017-08-30 09:34:36 -07:00