repo.or.cz
/
mcs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
add comment
[mcs.git]
/
tests
/
gtest-415.cs
blob
a71b5b98835f896e568bb3fd1ba9611167138cd7
1
// Compiler options: -unsafe
2
3
unsafe struct
S
4
{
5
public short
nData
;
6
public fixed int
Data
[
1
];
7
}
8
9
unsafe struct
S2
10
{
11
public uint
Header
;
12
public fixed byte
Data
[
5
];
13
14
public void
Test
()
15
{
16
fixed
(
byte
*
bP
=
Data
) {
17
S
*
p
= (
S
*)
bP
;
18
p
= (
S
*) (
p
->
Data
+
p
->
nData
);
19
}
20
}
21
22
public static void
Main
()
23
{
24
new
S2
().
Test
();
25
}
26
}
27