Skip to content

Commit

Permalink
Snapshots: Don't use an empty array where a NULL array is expected. (f…
Browse files Browse the repository at this point in the history
  • Loading branch information
rmacnak-google authored Jan 25, 2017
1 parent 1210a2e commit 275ffdc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
20 changes: 12 additions & 8 deletions lib/snapshot/snapshot.c.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@
// generated snapshot binary file for the vm isolate.
// This string forms the content of the dart vm isolate snapshot which
// is loaded into the vm isolate.
const uint8_t kDartVmSnapshotData[]
__attribute__((visibility("default"), aligned(8), used)) = { %s };
const uint8_t kDartVmSnapshotInstructions[]
__attribute__((visibility("default"), aligned(8), used)) = {};
static const uint8_t kDartVmSnapshotData_[]
__attribute__((aligned(8))) = { %s };
const uint8_t* kDartVmSnapshotData
__attribute__((visibility("default"), used)) = kDartVmSnapshotData_;
const uint8_t* kDartVmSnapshotInstructions
__attribute__((visibility("default"), used)) = NULL;

// The string on the next line will be filled in with the contents of the
// generated snapshot binary file for a regular dart isolate.
// This string forms the content of a regular dart isolate snapshot which
// is loaded into an isolate when it is created.
const uint8_t kDartIsolateSnapshotData[]
__attribute__((visibility("default"), aligned(8), used)) = { %s };
const uint8_t kDartIsolateSnapshotInstructions[]
__attribute__((visibility("default"), aligned(8), used)) = {};
static const uint8_t kDartIsolateSnapshotData_[]
__attribute__((aligned(8))) = { %s };
const uint8_t* kDartIsolateSnapshotData
__attribute__((visibility("default"), used)) = kDartIsolateSnapshotData_;
const uint8_t* kDartIsolateSnapshotInstructions
__attribute__((visibility("default"), used)) = NULL;
2 changes: 1 addition & 1 deletion runtime/dart_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern void* kDartIsolateSnapshotData;
extern void* kDartIsolateSnapshotInstructions;
}

#define DART_SYMBOL(symbol) (&symbol)
#define DART_SYMBOL(symbol) (symbol)

#endif // DART_ALLOW_DYNAMIC_RESOLUTION

Expand Down
8 changes: 4 additions & 4 deletions snapshotter/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
#include "lib/tonic/file_loader/file_loader.h"

extern "C" {
extern const uint8_t kDartVmSnapshotData[];
extern const uint8_t kDartVmSnapshotInstructions[];
extern const uint8_t kDartIsolateSnapshotData[];
extern const uint8_t kDartIsolateSnapshotInstructions[];
extern const uint8_t* kDartVmSnapshotData;
extern const uint8_t* kDartVmSnapshotInstructions;
extern const uint8_t* kDartIsolateSnapshotData;
extern const uint8_t* kDartIsolateSnapshotInstructions;
}

namespace {
Expand Down

0 comments on commit 275ffdc

Please sign in to comment.