Mapping index issues

I’m attempting to migrate a large preexisting mudlib (originally Lima but heavily modified) to FluffOS. This has brought with it some teething problems that I expected, but also one that appears to be a driver issue: indexing a mapping with a string argument to a function, or a copy of a string argument, seems to be broken on my build. For example, in the following code:

private mapping privileges;     // mapping containing all privileges

// (many lines cut here...)

nomask int valid_privilege(mixed p) {
   int n;
   array list;
   string sp;

   if (intp (p))
      return p == 0 || p == 1;
   n = member_array (':', p);

   if (n < 0)
      n = strlen (p);

   sp = p[n+1..];
   p  = p[0..n-1];

   if (sp[<1..<1] == ":")
      sp = sp[0..<2];

   if (list = privileges[p]) {
      if (!strlen(sp))
         return 1;
         return member_array(sp,list)!=-1;
   return 0;

privileges[p] will always evaluate to undefined. It remains undefined if I make a local copy of the string and index against that instead. However, indexing against a string constant with an appropriate value, or a local string variable set to one, will succeed, and member_array(p, keys(privileges)) returns != -1 as expected.

I suspect either an incorrectly configured build or a compatibility issue with my environment, but I’ve been unable to identify any build flags which might affect this behavior. Any pointers?

are you using the “master” build or the release build ? the v2019 branch contains some bug that hasn’t been fixed.

My most recent commit is this:

commit be141b30062a5cc5b39cbf153b02e714b4f3d549 (HEAD -> v2019, origin/v2019)
Author: Yucong Sun
Date: Sun Jan 10 03:04:37 2021 -0800

Improve memory accounting and debugmalloc dumping

I’ll try switching to a different build and see if that helps.

Yeah, use the last release , or the master branch

Master works. Thanks!

and this issue is fixed on v2019 branch too