From: Ben Pfaff Date: Tue, 15 Nov 2011 21:59:41 +0000 (-0800) Subject: ovsdb-idl: Add assertion for synthetic records in ovsdb_idl_read(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=942d31c8626773b46d81c48191456dcb1d60aa17;p=openvswitch ovsdb-idl: Add assertion for synthetic records in ovsdb_idl_read(). This function doesn't support synthetic records but it probably isn't obvious from looking at it, so add an actual assertion. --- diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index 439a40a1..19ae16fe 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -1112,8 +1112,13 @@ const struct ovsdb_datum * ovsdb_idl_read(const struct ovsdb_idl_row *row, const struct ovsdb_idl_column *column) { - const struct ovsdb_idl_table_class *class = row->table->class; - size_t column_idx = column - class->columns; + const struct ovsdb_idl_table_class *class; + size_t column_idx; + + assert(!ovsdb_idl_row_is_synthetic(row)); + + class = row->table->class; + column_idx = column - class->columns; assert(row->new != NULL); assert(column_idx < class->n_columns);