| 1209 | } |
| 1210 | |
| 1211 | static int |
| 1212 | xmlRegGetCounter(xmlRegParserCtxtPtr ctxt) { |
| 1213 | if (ctxt->maxCounters == 0) { |
| 1214 | ctxt->maxCounters = 4; |
| 1215 | ctxt->counters = (xmlRegCounter *) xmlMalloc(ctxt->maxCounters * |
| 1216 | sizeof(xmlRegCounter)); |
| 1217 | if (ctxt->counters == NULL) { |
| 1218 | xmlRegexpErrMemory(ctxt); |
| 1219 | ctxt->maxCounters = 0; |
| 1220 | return(-1); |
| 1221 | } |
| 1222 | } else if (ctxt->nbCounters >= ctxt->maxCounters) { |
| 1223 | xmlRegCounter *tmp; |
| 1224 | ctxt->maxCounters *= 2; |
| 1225 | tmp = (xmlRegCounter *) xmlRealloc(ctxt->counters, ctxt->maxCounters * |
| 1226 | sizeof(xmlRegCounter)); |
| 1227 | if (tmp == NULL) { |
| 1228 | xmlRegexpErrMemory(ctxt); |
| 1229 | ctxt->maxCounters /= 2; |
| 1230 | return(-1); |
| 1231 | } |
| 1232 | ctxt->counters = tmp; |
| 1233 | } |
| 1234 | ctxt->counters[ctxt->nbCounters].min = -1; |
| 1235 | ctxt->counters[ctxt->nbCounters].max = -1; |
| 1236 | return(ctxt->nbCounters++); |
| 1237 | } |
| 1238 | |
| 1239 | static int |
| 1240 | xmlRegAtomPush(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom) { |
no test coverage detected