On purpose to shoot around corners without exposing yourself to unfriendly fire! There have been several incarnations of barrels like that used for different militarys around the world. The Germans even had a rifle that would shoot around corners, but the bullets fragmented, might just as well have used a shotgun. Tanks crews had one for shooting anyone that got too close to their tank, stick the muzzle out the topside hatch and hose down the area outside their gun's zones of fire.
Tim