TIS-3D

TIS-3D

981k Downloads

Dividing by zero crashes Minecraft

josephcsible opened this issue ยท 3 comments

commented

Running the instruction "DIV 0" causes Minecraft to crash. Stack trace:

java.lang.ArithmeticException: / by zero
	at li.cil.tis3d.common.module.execution.instruction.InstructionDivImmediate.step(InstructionDivImmediate.java:16)
	at li.cil.tis3d.common.module.execution.MachineImpl.step(MachineImpl.java:62)
	at li.cil.tis3d.common.module.ModuleExecution.step(ModuleExecution.java:109)
	at li.cil.tis3d.common.machine.CasingImpl.stepModules(CasingImpl.java:119)
	at li.cil.tis3d.common.tileentity.TileEntityCasing.stepModules(TileEntityCasing.java:221)
	at li.cil.tis3d.common.tileentity.TileEntityController$$Lambda$240/952321792.accept(Unknown Source)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at li.cil.tis3d.common.tileentity.TileEntityController.step(TileEntityController.java:520)
	at li.cil.tis3d.common.tileentity.TileEntityController.func_73660_a(TileEntityController.java:358)
	at net.minecraft.world.World.func_72939_s(World.java:1811)
	at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:614)
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:765)
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:666)
	at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:185)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:524)
	at java.lang.Thread.run(Thread.java:745)

Tested on Minecraft 1.12.1, Forge 14.22.1.2484, and TIS-3D 1.2.3.7.

commented

HAHAHAHAHA. Oh wow. How did I not run into this before. Yeah, this should definitely result in a HCF instead.

commented

this is expected behavior /s

commented

On one hand, yes. On the other hand, this can be used as a DoS vector, so there should be something to catch this in the mod and perform a proper response in-game. Like having the module explode or give an error somewhere.