File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 15
15
rust_kernel::rust_kernel(rust_env *env) :
16
16
_region(env, true ),
17
17
_log(NULL ),
18
- max_task_id(0 ),
19
- max_port_id(0 ),
18
+ max_task_id(1 ),
19
+ max_port_id(1 ),
20
20
rval(0 ),
21
- max_sched_id(0 ),
21
+ max_sched_id(1 ),
22
22
sched_reaper(this ),
23
23
osmain_driver(NULL ),
24
24
non_weak_tasks(0 ),
@@ -116,6 +116,7 @@ rust_kernel::get_scheduler_by_id(rust_sched_id id) {
116
116
117
117
rust_scheduler *
118
118
rust_kernel::get_scheduler_by_id_nolock (rust_sched_id id) {
119
+ assert (id != 0 && " invalid scheduler id" );
119
120
sched_lock.must_have_lock ();
120
121
sched_map::iterator iter = sched_table.find (id);
121
122
if (iter != sched_table.end ()) {
@@ -250,6 +251,7 @@ rust_kernel::release_port_id(rust_port_id id) {
250
251
251
252
rust_port *
252
253
rust_kernel::get_port_by_id (rust_port_id id) {
254
+ assert (id != 0 && " invalid port id" );
253
255
scoped_lock with (port_lock);
254
256
rust_port *port = NULL ;
255
257
// get leaves port unchanged if not found.
You can’t perform that action at this time.
0 commit comments