If you generate capdl for a CNode with empty slots, capDL-tool incorrectly
calculates CDL_CapMap::num because it uses Map.size which doesn't include
empty slots. The right way to calculate "num" is by taking the max of the
key values +1.
diff --git a/capDL-tool/CapDL/PrintC.hs b/capDL-tool/CapDL/PrintC.hs
index ec0eda9..b4a2cbb 100644
--- a/capDL-tool/CapDL/PrintC.hs
+++ b/capDL-tool/CapDL/PrintC.hs
@@ -224,7 +224,7 @@ memberSlots objs obj_id slots irqNode cdt ms =
showSlots objs obj_id (Map.toList slots) irqNode cdt ms +++
"},"
where
- slot_count = Map.size slots
+ slot_count = if Map.null slots then 0 else (fst $ Map.findMax
slots) + 1
printInit :: [Word] -> String
printInit argv =
-Sam
_______________________________________________
Devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]