Jump to content




[CC 1.5][ssp]Program crash using string.find("any string", "[")


  • This topic is locked This topic is locked
3 replies to this topic

#1 Imred Gemu

  • Members
  • 47 posts

Posted 27 June 2013 - 06:12 PM

Version: [MC 1.4.7][CC 1.5][FTB DW20 5.3.2] Description: when working on a program I used string.find(sExample, "["), by entering the character "[" as the second argument to string.find() an error was thrown reading "vm error: java.lang.ArrayIndexOutOfBoundsException: 1", if this piece of code is used in the lua prompt the error simply is "1" in the color red. I have not tried this in the latest version but I am assuming it is still an issue since I have not seen anything in the change logs addressing it. Reproduction: create a file: arg1 = anystring, arg2 = "[" string.find(arg1, arg2), save and run, this program will crash.

#2 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 27 June 2013 - 09:00 PM

LuaJ bug, don't care.

#3 AfterLifeLochie

    Wiki Oracle

  • Moderators
  • 480 posts
  • LocationAfterLifeLochie's "Dungeon", Australia

Posted 29 June 2013 - 12:23 AM

This isn't a LuaJ bug - it's a malformed pattern causing your issue. You should read up on how Patterns work, particularly the Magic Characters section - and you'll find the solution to your problem.

#4 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 29 June 2013 - 12:29 AM

But the nature of the error message is still a LuaJ bug, but it wouldn't happen if you were using it properly!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users