The bug
Torches and redstone torches cannot be placed on top of a Jack o'Lantern but can be placed on pumpkin.
MC-118112 (same/similar issue) has status as this being resolved yet one still cannot place torches or redstone torches on top of Jack o'Lanterns but can do so on pumpkins.
Code analysis
Code analysis by @unknown can be found in this comment.
The following is based on a decompiled version of Minecraft 1.12 using MCP 9.40pre-1.
I think this might be intended since the game explicitly checks if the torch is placed on a
LIT_PUMPKIN
in the methodnet.minecraft.block.BlockTorch.canPlaceOn()
. With this check removed, torches can be placed on Jack o'Lanterns.