libgeda: Refuse to connect nets inside symbols with other nets.
commited432e7e2ff1c38d2b04608b2d0287e137788c1e
authorPeter TB Brett <peter@peter-b.co.uk>
Sat, 24 Nov 2012 22:06:09 +0000 (24 22:06 +0000)
committerPeter TB Brett <peter@peter-b.co.uk>
Sat, 24 Nov 2012 22:06:09 +0000 (24 22:06 +0000)
treef85adda32fbe8e0d55c0d187cff8afb44cba512b
parentd088ec192ac9fbc1dff3509527cb238520c2ee33
libgeda: Refuse to connect nets inside symbols with other nets.

A libgeda crash bug was caused by the pathological use case of putting
nets inside symbols.  Since the file format does not specifically
forbid this, libgeda must cope with this gracefully.  Specifically,
o_net_consolidate() was causing a crash when attempting to merge a net
inside a symbol and a normal net.  The underlying cause was found to
be that the connection tracking system did not cope properly with
encountering connectable objects other than pins inside symbols.
Merely fixing the net consolidation algorithm exposed other bugs (for
example, nets inside symbols should NOT rubberband!)

This patch adds logic to s_conn_update_line_object() as follows:

1) If two objects are both not inside symbols, they may connect.

2) If two objects are inside the same complex, they may connect.

3) If an object is inside a complex, it must be a pin to connect to
   objects outside the complex.

Closes-bug: lp-994361

(imported from commit c18a0826fcd43dc8471f98e3a092d3144fcb6918)
libgeda/scheme/unit-tests/t0108-object-connections.scm
libgeda/src/s_conn.c