Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old May 8, 2017, 23:14   #11
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,671
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by t4nk View Post
Nick, I got a crash from asan at obj-randart.c:2518:
Code:
while (strstr(art->name, "The One Ring") ||
	kf_has(kind->kind_flags, KF_QUEST_ART)) {
	(*aidx)++;
	art = &a_info[*aidx];
	art_level = art->level;
	if ((*aidx) >= z_info->a_max) {
		return;
	}
}
obj-init.c allocates z_info->a_max + 1 structs (line 2700), but note that it then increments a_max (line 2715). So accessing art->level when *aidx == a_max is illegal (perhaps that's the cause of Nomad's crash?)
Thank you, yes - I should be testing before incrementing.

Quote:
Originally Posted by t4nk View Post
(come to think of it, why does obj-init.c do that? and why does it start assigning from a_max, leaving zeroed out struct at the beginning?)
I don't actually remember. Each artifact in artifact.txt used to have an index, and they started at 1, and there was some code or other that relied on that fact, but I'm not at all sure it's necessary any more. I'll check at some point and change it if it's not needed, because it's a bit silly to do it for no reason.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bugs and complaints on current master Nick Vanilla 588 April 27, 2017 23:54
Master Thief Grotug Idle chatter 1 March 27, 2017 00:54
Sil 1.1.1 no-artefacts, polearm master bron AAR 21 August 28, 2013 00:42
Artifacts in 3.2 (Master List) Tregonsee Vanilla 8 March 6, 2011 12:33
State of Angband master branch d_m Development 80 November 26, 2010 15:14


All times are GMT +1. The time now is 18:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.