                 for casenum in [0...case_checks.length-1]
                         test = @visit case_checks[casenum].test
                         discTest = @createCall @ejs["binop==="], [discr, test], "test"
-                        discTest.setReadOnlyMemory()
+                        discTest.setOnlyReadsMemory()
                         disc_truthy = @createCall @ejs.truthy, [discTest], "disc_truthy"
-                        disc_truthy.setReadOnlyMemory()
+                        disc_truthy.setOnlyReadsMemory()
                         disc_cmp = irbuilder.createICmpEq disc_truthy, (llvm.Constant.getIntegerValue boolType, 0), "disccmpresult"
                         irbuilder.createCondBr disc_cmp, case_checks[casenum+1].dest_check, case_checks[casenum].body
                         irbuilder.setInsertPoint case_checks[casenum+1].dest_check

                        return @loadNullEjsValue() # this isn't properly typed...  dunno what to do about this here
                else if typeof n.raw is "string" and (n.raw[0] is '"' or n.raw[0] is "'")
                        debug.log "literal string: #{n.value}"
                        c = irbuilder.createGlobalStringPtr n.value, "strconst"
                        strcall = @createCall @ejs.string_new_utf8, [c], "strtmp"
                        debug.log "strcall = #{strcall}"
                        return strcall
                else if typeof n.raw is "string" and n.raw[0] is '/'
                        debug.log "literal regexp: #{n.raw}"
                        c = irbuilder.createGlobalStringPtr n.raw, "strconst"
                        regexpcall = @createCall @ejs.regexp_new_utf8, [c], "regexptmp"
                        debug.log "regexpcall = #{strcall}"
                        return regexpcall
                else if typeof n.value is "number"
                        debug.log "literal number: #{n.value}"

                ir_func.topScope = new_scope
                ir_func.entry_bb = entry_bb

                ir_func.stringLiteralAllocas = {}

                allocas = []

