Commit 8fba6a1
committed
Deal with mocks that do direct referencing of instance variables.
Reallocate class and partial mocks based on the size of the object they are mocking.
For class mocks allow direct referencing of instance variables.
For Partial mocks fills the space with 0xEC and will throw an exception if we detect that an instance variable has been written to. The value 0xEB will intentionally likely cause crashes if the memory is read.1 parent 2490353 commit 8fba6a1
File tree
5 files changed
+144
-18
lines changed- Source
- OCMockTests
- OCMock
5 files changed
+144
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
43 | | - | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
50 | 61 | | |
| 62 | + | |
51 | 63 | | |
52 | 64 | | |
53 | 65 | | |
54 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
55 | 71 | | |
56 | 72 | | |
57 | 73 | | |
| |||
68 | 84 | | |
69 | 85 | | |
70 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
71 | 97 | | |
72 | 98 | | |
73 | | - | |
| 99 | + | |
| 100 | + | |
74 | 101 | | |
75 | 102 | | |
76 | 103 | | |
| |||
89 | 116 | | |
90 | 117 | | |
91 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
92 | 129 | | |
93 | 130 | | |
94 | 131 | | |
| |||
104 | 141 | | |
105 | 142 | | |
106 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
107 | 153 | | |
108 | 154 | | |
109 | 155 | | |
| |||
119 | 165 | | |
120 | 166 | | |
121 | 167 | | |
| 168 | + | |
122 | 169 | | |
123 | 170 | | |
124 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
| 206 | + | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
209 | | - | |
| 210 | + | |
| 211 | + | |
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
213 | | - | |
| 215 | + | |
| 216 | + | |
214 | 217 | | |
215 | 218 | | |
216 | | - | |
| 219 | + | |
| 220 | + | |
217 | 221 | | |
218 | 222 | | |
219 | | - | |
| 223 | + | |
| 224 | + | |
220 | 225 | | |
221 | 226 | | |
222 | | - | |
| 227 | + | |
| 228 | + | |
223 | 229 | | |
224 | 230 | | |
225 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
226 | 234 | | |
227 | 235 | | |
228 | 236 | | |
229 | | - | |
| 237 | + | |
| 238 | + | |
230 | 239 | | |
231 | 240 | | |
232 | 241 | | |
233 | | - | |
| 242 | + | |
| 243 | + | |
234 | 244 | | |
235 | 245 | | |
236 | | - | |
| 246 | + | |
| 247 | + | |
237 | 248 | | |
238 | 249 | | |
239 | | - | |
| 250 | + | |
| 251 | + | |
240 | 252 | | |
241 | 253 | | |
242 | | - | |
| 254 | + | |
| 255 | + | |
243 | 256 | | |
244 | 257 | | |
245 | | - | |
| 258 | + | |
| 259 | + | |
246 | 260 | | |
247 | 261 | | |
248 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
43 | | - | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
66 | 90 | | |
67 | 91 | | |
68 | | - | |
| 92 | + | |
| 93 | + | |
69 | 94 | | |
70 | 95 | | |
71 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
196 | 212 | | |
197 | 213 | | |
198 | 214 | | |
| |||
1108 | 1124 | | |
1109 | 1125 | | |
1110 | 1126 | | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
1111 | 1149 | | |
1112 | 1150 | | |
1113 | 1151 | | |
0 commit comments