/[packages]/cauldron/ice/current/SOURCES/patch-3.5.1-3.txt
ViewVC logotype

Contents of /cauldron/ice/current/SOURCES/patch-3.5.1-3.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 757709 - (show annotations) (download)
Wed Oct 15 22:18:59 2014 UTC (9 years, 6 months ago) by luigiwalser
File MIME type: text/plain
File size: 11252 byte(s)
sync patches with fedora to fix build with java8
1 diff --git a/cs/src/Ice/BasicStream.cs b/cs/src/Ice/BasicStream.cs
2 index 1201c21..690638d 100644
3 --- a/cs/src/Ice/BasicStream.cs
4 +++ b/cs/src/Ice/BasicStream.cs
5 @@ -136,7 +136,7 @@ namespace IceInternal
6 _unlimited = unlimited;
7
8 _startSeq = -1;
9 - _sizePos = -1;
10 + _sizeStack = null;
11 }
12
13 //
14 @@ -223,9 +223,9 @@ namespace IceInternal
15 other._minSeqSize = _minSeqSize;
16 _minSeqSize = tmpMinSeqSize;
17
18 - int tmpSizePos = other._sizePos;
19 - other._sizePos = _sizePos;
20 - _sizePos = tmpSizePos;
21 + Stack<int> tmpSizeStack = other._sizeStack;
22 + other._sizeStack = _sizeStack;
23 + _sizeStack = tmpSizeStack;
24 }
25
26 public void resetEncaps()
27 @@ -733,15 +733,19 @@ namespace IceInternal
28
29 public void startSize()
30 {
31 - _sizePos = _buf.b.position();
32 + if(_sizeStack == null)
33 + {
34 + _sizeStack = new Stack<int>();
35 + }
36 + _sizeStack.Push(_buf.b.position());
37 writeInt(0); // Placeholder for 32-bit size
38 }
39
40 public void endSize()
41 {
42 - Debug.Assert(_sizePos >= 0);
43 - rewriteInt(_buf.b.position() - _sizePos - 4, _sizePos);
44 - _sizePos = -1;
45 + Debug.Assert(_sizeStack.Count > 0);
46 + int sizePos = _sizeStack.Pop();
47 + rewriteInt(_buf.b.position() - sizePos - 4, sizePos);
48 }
49
50 public void writeBlob(byte[] v)
51 @@ -3582,6 +3586,7 @@ namespace IceInternal
52 private Buffer _buf;
53 private object _closure;
54 private byte[] _stringBytes; // Reusable array for reading strings.
55 + private Stack<int> _sizeStack;
56
57 private enum SliceType { NoSlice, ObjectSlice, ExceptionSlice }
58
59 @@ -5410,8 +5415,6 @@ namespace IceInternal
60 private int _startSeq;
61 private int _minSeqSize;
62
63 - private int _sizePos;
64 -
65 private const byte OPTIONAL_END_MARKER = 0xFF;
66
67 private const byte FLAG_HAS_TYPE_ID_STRING = (byte)(1<<0);
68 diff --git a/java/src/IceInternal/BasicStream.java b/java/src/IceInternal/BasicStream.java
69 index b241147..c5bcbf5 100644
70 --- a/java/src/IceInternal/BasicStream.java
71 +++ b/java/src/IceInternal/BasicStream.java
72 @@ -62,7 +62,7 @@ public class BasicStream
73 _unlimited = unlimited;
74
75 _startSeq = -1;
76 - _sizePos = -1;
77 + _sizeStack = null;
78 }
79
80 //
81 @@ -155,9 +155,9 @@ public class BasicStream
82 other._minSeqSize = _minSeqSize;
83 _minSeqSize = tmpMinSeqSize;
84
85 - int tmpSizePos = other._sizePos;
86 - other._sizePos = _sizePos;
87 - _sizePos = tmpSizePos;
88 + java.util.Deque<Integer> tmpSizeStack = other._sizeStack;
89 + other._sizeStack = _sizeStack;
90 + _sizeStack = tmpSizeStack;
91 }
92
93 public void
94 @@ -715,16 +715,20 @@ public class BasicStream
95 public void
96 startSize()
97 {
98 - _sizePos = _buf.b.position();
99 + if(_sizeStack == null)
100 + {
101 + _sizeStack = new java.util.ArrayDeque<Integer>();
102 + }
103 + _sizeStack.push(_buf.b.position());
104 writeInt(0); // Placeholder for 32-bit size
105 }
106
107 public void
108 endSize()
109 {
110 - assert(_sizePos >= 0);
111 - rewriteInt(_buf.b.position() - _sizePos - 4, _sizePos);
112 - _sizePos = -1;
113 + assert(!_sizeStack.isEmpty());
114 + int sizePos = _sizeStack.pop();
115 + rewriteInt(_buf.b.position() - sizePos - 4, sizePos);
116 }
117
118 public void
119 @@ -2779,6 +2783,7 @@ public class BasicStream
120 private Object _closure;
121 private byte[] _stringBytes; // Reusable array for reading strings.
122 private char[] _stringChars; // Reusable array for reading strings.
123 + private java.util.Deque<Integer> _sizeStack;
124
125 private enum SliceType { NoSlice, ObjectSlice, ExceptionSlice }
126
127 @@ -4618,8 +4623,6 @@ public class BasicStream
128 private int _startSeq;
129 private int _minSeqSize;
130
131 - private int _sizePos;
132 -
133 private static final int OPTIONAL_END_MARKER = 0xFF;
134
135 private static final byte FLAG_HAS_TYPE_ID_STRING = (byte)(1<<0);
136 diff --git a/py/modules/IcePy/Types.cpp b/py/modules/IcePy/Types.cpp
137 index 85fec02..347e5f7 100644
138 --- a/py/modules/IcePy/Types.cpp
139 +++ b/py/modules/IcePy/Types.cpp
140 @@ -1232,11 +1232,15 @@ IcePy::StructInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, ObjectMa
141 {
142 assert(PyObject_IsInstance(p, pythonType.get()) == 1); // validate() should have caught this.
143
144 + int sizePos = -1;
145 if(optional)
146 {
147 if(_variableLength)
148 {
149 - os->startSize();
150 + // BUGFIX: #5481 startSize/endSize can't be nested
151 + //os->startSize();
152 + sizePos = os->pos();
153 + os->write(Ice::Int(0));
154 }
155 else
156 {
157 @@ -1266,7 +1270,9 @@ IcePy::StructInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, ObjectMa
158
159 if(optional && _variableLength)
160 {
161 - os->endSize();
162 + assert(sizePos != -1);
163 + //os->endSize();
164 + os->rewrite(os->pos() - sizePos - 4, sizePos);
165 }
166 }
167
168 @@ -1402,11 +1408,15 @@ IcePy::SequenceInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, Object
169 {
170 PrimitiveInfoPtr pi = PrimitiveInfoPtr::dynamicCast(elementType);
171
172 + int sizePos = -1;
173 if(optional)
174 {
175 if(elementType->variableLength())
176 {
177 - os->startSize();
178 + // BUGFIX: #5481 startSize/endSize can't be nested
179 + //os->startSize();
180 + sizePos = os->pos();
181 + os->write(Ice::Int(0));
182 }
183 else if(elementType->wireSize() > 1)
184 {
185 @@ -1490,7 +1500,9 @@ IcePy::SequenceInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, Object
186
187 if(optional && elementType->variableLength())
188 {
189 - os->endSize();
190 + assert(sizePos != -1);
191 + //os->endSize();
192 + os->rewrite(os->pos() - sizePos - 4, sizePos);
193 }
194 }
195
196 @@ -2480,11 +2492,15 @@ IcePy::DictionaryInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, Obje
197
198 const Ice::Int sz = p == Py_None ? 0 : static_cast<Ice::Int>(PyDict_Size(p));
199
200 + int sizePos = -1;
201 if(optional)
202 {
203 if(_variableLength)
204 {
205 - os->startSize();
206 + // BUGFIX: #5481 startSize/endSize can't be nested
207 + //os->startSize();
208 + sizePos = os->pos();
209 + os->write(Ice::Int(0));
210 }
211 else
212 {
213 @@ -2523,7 +2539,9 @@ IcePy::DictionaryInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, Obje
214
215 if(optional && _variableLength)
216 {
217 - os->endSize();
218 + assert(sizePos != -1);
219 + //os->endSize();
220 + os->rewrite(os->pos() - sizePos - 4, sizePos);
221 }
222 }
223
224 @@ -2958,9 +2976,13 @@ IcePy::ProxyInfo::optionalFormat() const
225 void
226 IcePy::ProxyInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, ObjectMap*, bool optional, const Ice::StringSeq*)
227 {
228 + int sizePos = -1;
229 if(optional)
230 {
231 - os->startSize();
232 + // BUGFIX: #5481 startSize/endSize can't be nested
233 + //os->startSize();
234 + sizePos = os->pos();
235 + os->write(Ice::Int(0));
236 }
237
238 if(p == Py_None)
239 @@ -2978,7 +3000,9 @@ IcePy::ProxyInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, ObjectMap
240
241 if(optional)
242 {
243 - os->endSize();
244 + assert(sizePos != -1);
245 + //os->endSize();
246 + os->rewrite(os->pos() - sizePos - 4, sizePos);
247 }
248 }
249
250 diff --git a/rb/src/IceRuby/Types.cpp b/rb/src/IceRuby/Types.cpp
251 index c4360f3..c52d12a 100644
252 --- a/rb/src/IceRuby/Types.cpp
253 +++ b/rb/src/IceRuby/Types.cpp
254 @@ -992,11 +992,15 @@ IceRuby::StructInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, ObjectMap*
255 {
256 assert(callRuby(rb_obj_is_kind_of, p, rubyClass) == Qtrue); // validate() should have caught this.
257
258 + int sizePos = -1;
259 if(optional)
260 {
261 if(_variableLength)
262 {
263 - os->startSize();
264 + // BUGFIX: #5481 startSize/endSize can't be nested
265 + //os->startSize();
266 + sizePos = os->pos();
267 + os->write(Ice::Int(0));
268 }
269 else
270 {
271 @@ -1018,7 +1022,9 @@ IceRuby::StructInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, ObjectMap*
272
273 if(optional && _variableLength)
274 {
275 - os->endSize();
276 + assert(sizePos != -1);
277 + //os->endSize();
278 + os->rewrite(os->pos() - sizePos - 4, sizePos);
279 }
280 }
281
282 @@ -1153,11 +1159,15 @@ IceRuby::SequenceInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, ObjectMa
283
284 volatile VALUE arr = Qnil;
285
286 + int sizePos = -1;
287 if(optional)
288 {
289 if(elementType->variableLength())
290 {
291 - os->startSize();
292 + // BUGFIX: #5481 startSize/endSize can't be nested
293 + //os->startSize();
294 + sizePos = os->pos();
295 + os->write(Ice::Int(0));
296 }
297 else if(elementType->wireSize() > 1)
298 {
299 @@ -1219,7 +1229,9 @@ IceRuby::SequenceInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, ObjectMa
300
301 if(optional && elementType->variableLength())
302 {
303 - os->endSize();
304 + assert(sizePos != -1);
305 + //os->endSize();
306 + os->rewrite(os->pos() - sizePos - 4, sizePos);
307 }
308 }
309
310 @@ -1372,7 +1384,7 @@ IceRuby::SequenceInfo::marshalPrimitiveSequence(const PrimitiveInfoPtr& pi, VALU
311 const long len = RSTRING_LEN(str);
312 if(s == 0 || len == 0)
313 {
314 - os->writeSize(0);
315 + os->write(Ice::Int(0));
316 }
317 else
318 {
319 @@ -1721,11 +1733,15 @@ IceRuby::DictionaryInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, Object
320 sz = RHASH_SIZE(hash);
321 }
322
323 + int sizePos = -1;
324 if(optional)
325 {
326 if(_variableLength)
327 {
328 - os->startSize();
329 + // BUGFIX: #5481 startSize/endSize can't be nested
330 + //os->startSize();
331 + sizePos = os->pos();
332 + os->write(Ice::Int(0));
333 }
334 else
335 {
336 @@ -1749,7 +1765,9 @@ IceRuby::DictionaryInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, Object
337
338 if(optional && _variableLength)
339 {
340 - os->endSize();
341 + assert(sizePos != -1);
342 + //os->endSize();
343 + os->rewrite(os->pos() - sizePos - 4, sizePos);
344 }
345 }
346
347 @@ -2301,9 +2319,13 @@ IceRuby::ProxyInfo::optionalFormat() const
348 void
349 IceRuby::ProxyInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, ObjectMap*, bool optional)
350 {
351 + int sizePos = -1;
352 if(optional)
353 {
354 - os->startSize();
355 + // BUGFIX: #5481 startSize/endSize can't be nested
356 + //os->startSize();
357 + sizePos = os->pos();
358 + os->write(Ice::Int(0));
359 }
360
361 if(NIL_P(p))
362 @@ -2318,7 +2340,9 @@ IceRuby::ProxyInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, ObjectMap*,
363
364 if(optional)
365 {
366 - os->endSize();
367 + assert(sizePos != -1);
368 + //os->endSize();
369 + os->rewrite(os->pos() - sizePos - 4, sizePos);
370 }
371 }
372

Properties

Name Value
svn:eol-style native

  ViewVC Help
Powered by ViewVC 1.1.30