| 1237 | } |
| 1238 | |
| 1239 | static int |
| 1240 | xmlRegAtomPush(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom) { |
| 1241 | if (atom == NULL) { |
| 1242 | ERROR("atom push: atom is NULL"); |
| 1243 | return(-1); |
| 1244 | } |
| 1245 | if (ctxt->nbAtoms >= ctxt->maxAtoms) { |
| 1246 | size_t newSize = ctxt->maxAtoms ? ctxt->maxAtoms * 2 : 4; |
| 1247 | xmlRegAtomPtr *tmp; |
| 1248 | |
| 1249 | tmp = xmlRealloc(ctxt->atoms, newSize * sizeof(xmlRegAtomPtr)); |
| 1250 | if (tmp == NULL) { |
| 1251 | xmlRegexpErrMemory(ctxt); |
| 1252 | return(-1); |
| 1253 | } |
| 1254 | ctxt->atoms = tmp; |
| 1255 | ctxt->maxAtoms = newSize; |
| 1256 | } |
| 1257 | atom->no = ctxt->nbAtoms; |
| 1258 | ctxt->atoms[ctxt->nbAtoms++] = atom; |
| 1259 | return(0); |
| 1260 | } |
| 1261 | |
| 1262 | static void |
| 1263 | xmlRegStateAddTransTo(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr target, |
no test coverage detected