- case 1:
- if (read_vbr(Buf, EndBuf, Result->Arg1))
- throw std::string("Error reading from buffer");
- break;
- case 2:
- if (read_vbr(Buf, EndBuf, Result->Arg1) ||
- read_vbr(Buf, EndBuf, Result->Arg2))
- throw std::string("Error reading from buffer");
- break;
- case 3:
- if (read_vbr(Buf, EndBuf, Result->Arg1) ||
- read_vbr(Buf, EndBuf, Result->Arg2) ||
- read_vbr(Buf, EndBuf, Result->Arg3))
- throw std::string("Error reading from buffer");
- break;
- default:
- if (read_vbr(Buf, EndBuf, Result->Arg1) ||
- read_vbr(Buf, EndBuf, Result->Arg2))
- throw std::string("Error reading from buffer");
-
- // Allocate a vector to hold arguments 3, 4, 5, 6 ...
- Result->VarArgs = new std::vector<unsigned>(Result->NumOperands-2);
- for (unsigned a = 0; a < Result->NumOperands-2; a++)
- if (read_vbr(Buf, EndBuf, (*Result->VarArgs)[a]))
- throw std::string("Error reading from buffer");