| 337 | } |
| 338 | |
| 339 | void Marshaller::setArrayItem(int index, int arrayIndex) { |
| 340 | auto array = getArray(index); |
| 341 | if (!_exceptionTracker) { |
| 342 | return; |
| 343 | } |
| 344 | |
| 345 | auto valueToPlace = get(-1); |
| 346 | if (!_exceptionTracker) { |
| 347 | return; |
| 348 | } |
| 349 | pop(); |
| 350 | |
| 351 | auto arrayIndexSizeT = static_cast<size_t>(arrayIndex); |
| 352 | if (arrayIndex < 0 || arrayIndexSizeT >= array->size()) { |
| 353 | _exceptionTracker.onError( |
| 354 | Error(STRING_FORMAT("Out of bounds index {}, array size is {}", arrayIndex, array->size()))); |
| 355 | return; |
| 356 | } |
| 357 | |
| 358 | array->emplace(static_cast<int>(arrayIndex), std::move(valueToPlace)); |
| 359 | } |
| 360 | |
| 361 | int Marshaller::pushMap(int expectedCapacity) { |
| 362 | auto map = makeShared<ValueMap>(); |