Skip to content

Instantly share code, notes, and snippets.

@FROGGS
Created October 8, 2014 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FROGGS/8339a718c471294aea47 to your computer and use it in GitHub Desktop.
Save FROGGS/8339a718c471294aea47 to your computer and use it in GitHub Desktop.
diff --git a/compilers/imcc/imcc.y b/compilers/imcc/imcc.y
index 48d3c12..2f269fe 100644
--- a/compilers/imcc/imcc.y
+++ b/compilers/imcc/imcc.y
@@ -1929,14 +1929,9 @@ labeled_inst:
}
| LEXICAL STRINGC COMMA target
{
- SymReg *n;
- /* This strips the " and ' quotes and treats both as ' */
- char *name = mem_sys_strdup($2 + 1);
- name[strlen(name) - 1] = 0;
- n = mk_const(imcc, name, 'S');
+ SymReg *n = mk_const(imcc, name, 'S');
set_lexical(imcc, $4, n); $$ = 0;
mem_sys_free($2);
- mem_sys_free(name);
}
| LEXICAL USTRINGC COMMA target
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment