Skip to content

Commit de65559

Browse files
committed
---
yaml --- r: 14431 b: refs/heads/try c: c16bfbe h: refs/heads/master i: 14429: d6c78f9 14427: 93f268d 14423: d0d1032 14415: f09156e 14399: 4e7881e v: v3
1 parent ce5a481 commit de65559

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 27ab663845e66d908ec4e4549d333e95561dbe26
5+
refs/heads/try: c16bfbe0c365b6d3f0c274a53bc1374822766e6b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rt/rust_log.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ rust_log::trace_ln(char *prefix, char *message) {
106106
void
107107
rust_log::trace_ln(rust_task *task, uint32_t level, char *message) {
108108

109+
if (task) {
110+
// There is not enough room to be logging on the rust stack
111+
assert(!task->on_rust_stack() && "logging on rust stack");
112+
}
109113

110114
// FIXME: The scheduler and task names used to have meaning,
111115
// but they are always equal to 'main' currently

branches/try/src/rt/rust_task.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ void task_start_wrapper(spawn_args *a)
196196
if(env) {
197197
// free the environment (which should be a unique closure).
198198
const type_desc *td = env->td;
199-
LOG(task, task, "Freeing env %p with td %p", env, td);
200199
td->drop_glue(NULL, NULL, td->first_param, box_body(env));
201200
upcall_free_shared_type_desc(env->td);
202201
upcall_shared_free(env);
@@ -720,6 +719,11 @@ Returns true if we're currently running on the Rust stack
720719
*/
721720
bool
722721
rust_task::on_rust_stack() {
722+
if (stk == NULL) {
723+
// This only happens during construction
724+
return false;
725+
}
726+
723727
uintptr_t sp = get_sp();
724728
bool in_first_segment = sp_in_stk_seg(sp, stk);
725729
if (in_first_segment) {

0 commit comments

Comments
 (0)