mirror of
https://github.com/ziglang/zig.git
synced 2026-01-11 18:05:11 +00:00
14 lines
353 B
Zig
14 lines
353 B
Zig
const builtin = @import("builtin");
|
|
const std = @import("std");
|
|
const assertOrPanic = std.debug.assertOrPanic;
|
|
|
|
test "casting random address to function pointer" {
|
|
randomAddressToFunction();
|
|
comptime randomAddressToFunction();
|
|
}
|
|
|
|
fn randomAddressToFunction() void {
|
|
var addr: usize = 0xdeadbeef;
|
|
var ptr = @intToPtr(fn () void, addr);
|
|
}
|