diff --git a/tools/codegen/core/experiments_compiler.py b/tools/codegen/core/experiments_compiler.py index 8d9a7aeaf62..d15c7bb144b 100644 --- a/tools/codegen/core/experiments_compiler.py +++ b/tools/codegen/core/experiments_compiler.py @@ -326,7 +326,7 @@ class ExperimentsCompiler(object): "const char* const additional_constraints_%s = %s;" % (exp.name, ToCStr(json.dumps(exp.additional_constraints))), file=C) - have_defaults.add(exp.default) + have_defaults.add(self._defaults[exp.default]) if 'kDefaultForDebugOnly' in have_defaults: print("#ifdef NDEBUG", file=C) if 'kDefaultForDebugOnly' in have_defaults: diff --git a/tools/codegen/core/gen_experiments.py b/tools/codegen/core/gen_experiments.py index 0dac030e93e..31d88f99bdb 100755 --- a/tools/codegen/core/gen_experiments.py +++ b/tools/codegen/core/gen_experiments.py @@ -39,7 +39,7 @@ FINAL_RETURN = { 'broken': 'return false;', False: 'return false;', True: 'return true;', - 'debug': '#ifdef NDEBUG\nreturn false;\n#else\nreturn true;\n#endif', + 'debug': '\n#ifdef NDEBUG\nreturn false;\n#else\nreturn true;\n#endif\n', } FINAL_DEFINE = {