auto_set_wire_bus(): error checks to avoid segfaults
This commit is contained in:
parent
8c844cc0c9
commit
1cd23c0ddb
|
|
@ -1619,12 +1619,14 @@ void auto_set_wire_bus(int start, int end)
|
|||
if(xctx->netlist_count) return; /* do this only in top level */
|
||||
if(end > xctx->wires) return;
|
||||
if(start < 0) return;
|
||||
if(!xctx->prep_hi_structs) return;
|
||||
cc = WIRELAYER; if(xctx->only_probes) cc = GRIDLAYER;
|
||||
regcomp(&re, "(.+\\[.+(:|\\.\\.)[^.]+\\])|(,)", REG_NOSUB | REG_EXTENDED);
|
||||
|
||||
for(i = start;i < end; ++i) {
|
||||
bus = 0;
|
||||
oldbus = xctx->wire[i].bus;
|
||||
if(!xctx->wire[i].node) continue;
|
||||
if(!regexec(&re, xctx->wire[i].node, 0 , NULL, 0) ) bus = 1;
|
||||
if( (oldbus == 0.0 && bus == 1) || (oldbus == -1.0 && bus == 0) ) {
|
||||
dbg(1, "auto_set_wire_bus(): i=%d, oldbus=%g bus=%d\n", i, oldbus, bus);
|
||||
|
|
|
|||
Loading…
Reference in New Issue