From b028e725e35629e0405d237942e97a73843ae35b Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 5 Jan 2009 20:09:02 +0000 Subject: 2009-01-05 Joel Sherrill * score/include/rtems/score/object.h, score/src/objectallocatebyindex.c: Object index should be int. Fix bug when index is negative. * score/src/objectextendinformation.c: Do not allow maximum number of allocated objects to exceed maximum representable in index field of Object Id. * score/src/objectgetisr.c: Use same code that is in _Objects_Get to extract index field of Object Id. --- cpukit/score/src/objectextendinformation.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cpukit/score/src/objectextendinformation.c') diff --git a/cpukit/score/src/objectextendinformation.c b/cpukit/score/src/objectextendinformation.c index 4e525110a9..f699e940a3 100644 --- a/cpukit/score/src/objectextendinformation.c +++ b/cpukit/score/src/objectextendinformation.c @@ -113,6 +113,14 @@ void _Objects_Extend_information( maximum = information->maximum + information->allocation_size; + /* + * We need to limit the number of objects to the maximum number + * representable in the index portion of the object Id. In the + * case of 16-bit Ids, this is only 256 object instances. + */ + if ( maximum > OBJECTS_ID_FINAL_INDEX ) + return; + /* * Allocate the tables and break it up. */ -- cgit v1.2.3