BYOND Version:454
Operating System:Windows 7 64-bit
Web Browser:Firefox 3.5.4
Status: Deferred

This issue may be low priority or very difficult to fix, and has been put on the back burner for the time being.
Descriptive Problem Summary:
I've been studying more about DMB files through experimentation and happen to find the cause of some of the runtime errors involving a global without providing a variable name. When you use it in the form of global << while trying to attempt output (no global variable, but global by itself), it will not be able to what I think is the stack properly.

world << global (Just an example) on the other hand what I think will load the wrong value into the stack, which can cause a misread. This was while I was still researching about DMB files.

Numbered Steps to Reproduce Problem:
Look at two sets of source code below

Code Snippet (if applicable) to Reproduce Problem:
world << global // 33 00 E5 FF 33 00 03 00 (0300 was meant for normal output operation)

global << world // 33 00 33 00 E5 FF 03 00 (Loads the load operation from what I can tell instead of world. Of course from what I have right now, there are two forms of the output operator due to the [] macro included in strings.

Expected Results:
Compilation error normally for not including any variable.

Actual Results:
Compiles anyway, though with runtime errors when such procs are run.

Does the problem occur:
Every time? Or how often? Everytime
In other games? N/A
In other user accounts? N/A
On other computers? N/A

When does the problem NOT occur? As long you include a variable or proc name (though this applies to global variables from my testing).

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit to download old versions for testing.) N/A

Best thing to do is not output to and from global unless you define a global variable. I assume this problem may require digging through possibly ancient code I heard about to at least block such future occurrences.
Tested in 509.1319 and 510.1322.

Descriptive Problem Summary:
'global' can be used seemingly like any other variable, but generally runtimes with weird 'cannot read null.[something]' runtimes on execution

Numbered Steps to Reproduce Problem:
1. Use 'global' for something
2. Runtime

Code Snippet (if applicable) to Reproduce Problem:
for(var/P in typesof(/proc))

for(var/v in global) // Cannot read null.area

var/x = global // Cannot read null.y

global() // Cannot read null.icon

global = null // Cannot modify null..

global += 1 // Cannot read null.

.(global) // Cannot read null.opacity

global["foo"] // Cannot read null.view

var/x = global + global // Cannot read null.x

return global // Cannot read null.Northwest

for(global in list()) // Cannot modify null.Northeast

if(global in list()) // Cannot read null.screen_loc

new global() // Cannot read null.Exit

md5(global) // Cannot read null.Error

istype(global, /datum) // Cannot read null.view

istype(null, global) // Cannot read null.cache_lifespan

istype(global, global) // Cannot read null.x

var/x = "[global]" // Cannot read null.Enter

ispath(null, global) // Cannot read null./matrix

world.Del(global) // Cannot read null.text

testT(global) // Cannot read null.density

..(global) // Cannot read null.visibility

throw(global) // Cannot read null.AREA_LAYER

Expected Results:
Code above would not compile, or would give meaningful results in the case of testA (and possibly testB/testF/testG)

Actual Results:
Code above compiles, all of testA through testV runtime on the commented line with the commented message.

Does the problem occur:
Every time? Or how often? Every time
In other games? N/A
In other user accounts? Untested
On other computers? Untested

When does the problem NOT occur? Unknown

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Unknown

Workarounds: Don't use global like this?

In response to GinjaNinja32
Man if only testA was a legit thing you can do...
In response to GinjaNinja32

You are missing testH()
In response to GinjaNinja32
Yep, must have missed that. G/H were added after posting, I did a bit more testing.
In response to GinjaNinja32
2 Questions, Did you get it to work yet, and what is the purpose of the function?
In response to Dragonpearl123
I'm not sure what you mean?
In response to GinjaNinja32
What I am trying to say is, what is the purpose of the global A-H and can you find an exploit around it.
In response to Dragonpearl123
Each check runtimes. Putting each in its own proc lets them all run without crashing each other. I'm not sure what you mean by "can you find an exploit around it".
In response to GinjaNinja32
Every problem has more than one solution on byond. Just find another way to check runtimes.
In response to Dragonpearl123
I don't think Ginja here was trying to find a practical use for it, he just encountered it and decided it'd be worth reporting, because why not?
In response to GinjaNinja32
So basically, the compiler should be failing the build, but it keeps on trucking somehow.

Each time it encounters 'global' without a variable after it, it builds in the op code 0x33 (load reference), but doesn't finish the code by saying what it needs to load.

testB, for instance, starts of with 0x33, and then is immediately followed by 0x34 (store reference). The 0x33 code thinks that the 0x34 is the variable it is supposed to be loading. Coincidentally, 0x34 is also the string ID for "y". This is happening in each case, with different operations being interpreted as different strings each time.
In response to GinjaNinja32
I know my post is a tad bit late, but I remember encountering a very similar bug involved with global. In fact, there are plenty of crazy bugs involving global.

Here is my old report in reference to the '<<' operator:

Due to the nature of this bug; it is very unlikely it will get fixed. Especially, when this bug happens during the compilation process; resulting in invalid code that leads to many runtime errors.
(Filed under Dream Maker because Lummox has said in the past that this should not compile, but whatever nonsense code DM is spitting out also has a clear effect on DD)

Descriptive Problem Summary:
In nearly all cases, the compiler will not error if the "global" keyword is treated as a var. If Dream Daemon executes any code where you do so (other than variable access, of course), a runtime will occur. This runtime will almost always be of the form "Cannot read null.[something]" where [something] is the name of a seemingly random built-in var, const, or proc.

Numbered Steps to Reproduce Problem:
1. Insert any of the below lines of code somewhere they will be executed, such as in /world/New()

Code Snippet (if applicable) to Reproduce Problem:
Each line is a separate case, to be clear.
var/a = global //Runtime is the same regardless of var name
throw global
global++ //All operate-and-assign operators have the same runtime when global is the LHS
global + 1 //Same for all mathematical operators where global is first, and all commutative operators regardless of order
1 - global //Non-commutative ones vary when global is the second, though. This is only one example.
var/a = "[global]" //Same regardless of anything else in the string
world.log << "[global]" //Also the same regardless of anything else in the string
world.log << global
var/b = global?.a //Where a is a valid global var. Also the name of b doesn't matter.
world.log << global?.a //Where a is a valid global var.

And countless others, of course. This is just a sampling of them that demonstrates that context matters, and that the "something" in null.something can at least be the names of built-in global consts (such as UP), member variables (y), member procs (Enter), and even seemingly strings with built-in significance (plural), and that at least two other kinds of runtimes can happen.

Expected Results:
Compile failure

Actual Results:
(Each runtime corresponds to one of the above lines of code, in the same order.)
Cannot read null.y
Cannot read null.UP
Cannot read null. //That's not a typo, it does just say null.
Cannot read null.mob
Cannot read null.statpanel
Cannot read null.plural
Cannot read null.Enter
BYOND Error: bad instruction: 417
//This one actually doesn't runtime for some reason. Thought it was interesting to include anyway.
Cannot read null.TURF_LAYER
BUG: Crashing due to an illegal operation!

When does the problem NOT occur?
When you don't treat "global" as a var except for global.whatever

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit to download old versions for testing.)
Only tested in 512.1427, but according to Lummox, "it's almost certainly not new"

This is nonsense code which shouldn't compile. Don't write nonsense code, I guess.
In response to Exxion
In response to Exxion
Well I guess that means the characterization as "not new" was correct
In response to Exxion