(b *Builder, v *Value)
| 44 | } |
| 45 | |
| 46 | func (e *exceptions) throw(b *Builder, v *Value) { |
| 47 | t := b.m.Types |
| 48 | voidPtr := t.Pointer(b.m.Types.Void) |
| 49 | ex := b.Call(e.allocFn, b.Scalar(v.Type().SizeInBits()/8).Cast(t.Size)) |
| 50 | ex.Cast(t.Pointer(v.Type())).Store(v) |
| 51 | ty, ok := e.typeInfos[v.Type()] |
| 52 | if !ok { |
| 53 | fail("Unsuporrted exception type %v", v.Type()) |
| 54 | } |
| 55 | destructor := b.Zero(voidPtr) |
| 56 | b.Call(e.throwFn, ex, ty.Value(b).Cast(voidPtr), destructor) |
| 57 | } |