diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
new file mode 100644
index aea9d40..7616cfc
*** a/src/backend/access/common/heaptuple.c
--- b/src/backend/access/common/heaptuple.c
*************** bool
*** 1321,1327 ****
  slot_attisnull(TupleTableSlot *slot, int attnum)
  {
  	HeapTuple	tuple = slot->tts_tuple;
! 	TupleDesc	tupleDesc = slot->tts_tupleDescriptor;
  
  	/*
  	 * system attributes are handled by heap_attisnull
--- 1321,1328 ----
  slot_attisnull(TupleTableSlot *slot, int attnum)
  {
  	HeapTuple	tuple = slot->tts_tuple;
! 
! 	Assert(attnum <= slot->tts_tupleDescriptor->natts);
  
  	/*
  	 * system attributes are handled by heap_attisnull
*************** slot_attisnull(TupleTableSlot *slot, int
*** 1342,1353 ****
  		return slot->tts_isnull[attnum - 1];
  
  	/*
- 	 * return NULL if attnum is out of range according to the tupdesc
- 	 */
- 	if (attnum > tupleDesc->natts)
- 		return true;
- 
- 	/*
  	 * otherwise we had better have a physical tuple (tts_nvalid should equal
  	 * natts in all virtual-tuple cases)
  	 */
--- 1343,1348 ----
