graydon/rust — Issue #1034: Binding a single-variant nullary tag does not work
Author: brson
Created: 2011-10-12 21:25:11+00:00
State: open
Labels: bug, trans, unassigned

```
ag chan {
chan_t;
}

fn wrapper3(i: chan) {
log_err i;
}

fn main() {
let wrapped = bind wrapper3(chan_t);
wrapped();
}
```

```
==6782== Thread 5:
==6782== Use of uninitialised value of size 4
==6782== at 0x6E9F24E: ??? (in /usr/lib32/libstdc++.so.6.0.14)
==6782== by 0x6E9F383: std::ostreambuf_iterator > std::num_put > >:
:_M_insert_int(std::ostreambuf_iterator >, std::ios_base&, char, unsigned long) const (in /usr/lib32/libstdc++.so.6
.0.14)
==6782== by 0x6E9F6CC: std::num_put > >::do_put(std::ostreambuf_iterator >, std::ios_base&, char, unsigned long) const (in /usr/lib32/libstdc++.so.6.0.14)
==6782== by 0x6EAAF78: std::ostream& std::ostream::_M_insert(unsigned long) (in /usr/lib32/libstdc++.so.6.0.14)
==6782== by 0x4954932: shape::ctxt >::walk() (ostream:195)
==6782== by 0x495331D: upcall_log_type (rust_shape.cpp:568)
==6782== by 0x80488AD: wrapper3::_bbd77563ebb906ad (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782== by 0x8048AE3: main::thunk7 (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782== by 0x8048948: main::_39837a48639a8d6b (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782== by 0x8048A37: _rust_main (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782== by 0x8048D8B: _rust_main_wrap (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782== by 0xDEADBEEE: ???
==6782==
==6782== Conditional jump or move depends on uninitialised value(s)
==6782== at 0x6E9F257: ??? (in /usr/lib32/libstdc++.so.6.0.14)
==6782== by 0x6E9F383: std::ostreambuf_iterator > std::num_put > >::_M_insert_int(std::ostreambuf_iterator >, std::ios_base&, char, unsigned long) const (in /usr/lib32/libstdc++.so.6.0.14)
==6782== by 0x6E9F6CC: std::num_put > >::do_put(std::ostreambuf_iterator >, std::ios_base&, char, unsigned long) const (in /usr/lib32/libstdc++.so.6.0.14)
==6782== by 0x6EAAF78: std::ostream& std::ostream::_M_insert(unsigned long) (in /usr/lib32/libstdc++.so.6.0.14)
==6782== by 0x4954932: shape::ctxt >::walk() (ostream:195)
==6782== by 0x495331D: upcall_log_type (rust_shape.cpp:568)
==6782== by 0x80488AD: wrapper3::_bbd77563ebb906ad (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782== by 0x8048AE3: main::thunk7 (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782== by 0x8048948: main::_39837a48639a8d6b (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782== by 0x8048A37: _rust_main (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782== by 0x8048D8B: _rust_main_wrap (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782== by 0xDEADBEEE: ???
==6782==
```